# RevCent MCP Guide: `FixUserShop`

AI/MCP-focused guide for fixing a RevCent User Shop, also called a Third-Party Shop.

This document explains when to use `FixUserShop`, what it attempts to fix, and how it should be used after `ValidateUserShop`.

---

## Operation Summary

Operation:

```text
FixUserShop
```

Title:

```text
Fix A User Shop
```

Purpose:

```text
Fix an existing User Shop in RevCent by checking the RevCent plugin settings and attempting to fix configuration issues.
```

`FixUserShop` should be run after `ValidateUserShop` if validation returns errors.

Recommended flow:

```text
CreateUserShop
    ↓
ValidateUserShop
    ↓
If validation returns an error:
        Run FixUserShop once
        ↓
        Run ValidateUserShop again if needed
```

---

## When to Use

Use `FixUserShop` only when:

```text
ValidateUserShop returns an error or configuration issue.
```

Do not run `FixUserShop` as the first step.

Always validate first.

Correct sequence:

```text
ValidateUserShop
    ↓
Validation error returned
    ↓
FixUserShop
    ↓
ValidateUserShop again
```

---

## What `FixUserShop` Does

`FixUserShop` connects to the user's shop and checks settings related to the RevCent plugin.

It then attempts to automatically fix required RevCent plugin configuration issues.

For WooCommerce shops, this commonly means RevCent is attempting to fix settings related to the RevCent Payments plugin.

Conceptual behavior:

```text
RevCent connects to the shop
    ↓
RevCent checks RevCent plugin settings
    ↓
RevCent attempts to fix required plugin configuration issues
    ↓
Any remaining issues are returned as an error/result
```

---

## What `FixUserShop` Does Not Do

`FixUserShop` is limited to required RevCent plugin settings.

It does not fix:

- unrelated WooCommerce plugin issues,
- unrelated WordPress issues,
- custom store code,
- theme issues,
- server configuration problems,
- hosting problems,
- DNS or SSL issues,
- payment gateway problems unrelated to RevCent settings,
- third-party plugin conflicts,
- broken checkout code,
- unrelated store API problems.

Important:

```text
FixUserShop is not a general WooCommerce repair tool.
```

It only attempts to fix required RevCent plugin configuration issues.

---

## Input Schema

`FixUserShop` requires:

| Field | Type | Required | Description |
|---|---:|---:|---|
| `user_shop_id` | string | Yes | 20-character User Shop ID. |

Example request:

```json
{
  "user_shop_id": "XXXXXXXXXXXXXXXXXXXX"
}
```

If the User Shop ID is unknown, use `GetUserShops` to retrieve the list of User Shops and identify the correct ID.

---

## Output Schema

Successful output can include:

| Field | Type | Description |
|---|---:|---|
| `api_call_id` | string | 20-character API call ID. |
| `api_call_unix` | integer | Unix timestamp when the API call was initiated. |
| `code` | integer | API response code. |
| `user_shop_id` | string | 20-character User Shop ID. |
| `result` | string | Result message describing the fix result or remaining issue. |

The `result` field must be read carefully.

If the result indicates remaining errors, the user may need customer support or manual resolution.

---

## Error Handling Workflow

If `ValidateUserShop` returns an error:

```text
1. Read the ValidateUserShop result.
2. Run FixUserShop once.
3. Read the FixUserShop result.
4. Run ValidateUserShop again if needed.
5. If errors remain, read the error result and notify the user that support/manual resolution is needed.
```

Do not repeatedly run `FixUserShop` without reviewing the returned error/result.

Recommended rule:

```text
Run FixUserShop once after ValidateUserShop returns an error.
```

If the issue remains after that, the problem may be outside what RevCent can automatically fix.

---

## Relationship to `ValidateUserShop`

`ValidateUserShop` and `FixUserShop` should be used together.

| Operation | Purpose |
|---|---|
| `ValidateUserShop` | Checks whether the User Shop and RevCent plugin settings are properly configured. |
| `FixUserShop` | Attempts to fix required RevCent plugin settings when validation returns errors. |

Correct AI/MCP logic:

```text
Validate first.
Fix only if validation reports an error.
Validate again if needed.
```

---

## Best Practices

- Always run `ValidateUserShop` before `FixUserShop`.
- Run `FixUserShop` only if validation returns errors.
- Run `FixUserShop` once, not repeatedly.
- Read the returned `result`.
- Validate again after running the fix.
- If errors remain, notify the user that customer support or manual troubleshooting may be required.
- Do not represent `FixUserShop` as fixing all WooCommerce/store problems.
- Do not use `FixUserShop` to fix DNS, SSL, custom code, unrelated plugins, or unrelated checkout issues.

---

## AI/MCP Decision Guide

| Situation | Correct Action |
|---|---|
| User Shop was just created | Run `ValidateUserShop`. |
| Validation succeeds | Continue shop setup and import/mapping workflows. |
| Validation returns an error | Run `FixUserShop` once. |
| Fix operation succeeds | Run `ValidateUserShop` again if needed. |
| Error remains after fix | Read result and tell user support/manual resolution is required. |
| User Shop ID is unknown | Use `GetUserShops` first. |
| Issue is unrelated to RevCent plugin settings | Do not claim `FixUserShop` will fix it. |

---

## Example Correct Flow

```text
CreateUserShop
    ↓
ValidateUserShop
    ↓
Validation result says plugin setting issue exists
    ↓
FixUserShop
    ↓
ValidateUserShop
    ↓
If valid:
    continue shipping method import, offline payment method import, and product import
    ↓
If still invalid:
    explain result and escalate to support/manual troubleshooting
```

---

## Final AI/MCP Instruction

Use `FixUserShop` only after `ValidateUserShop` returns errors.

`FixUserShop` connects to the user's shop, checks required RevCent plugin settings, and attempts to automatically fix configuration issues related to the RevCent plugin.

Run it once after validation returns an error. Then validate again if needed.

If errors remain after running `FixUserShop`, read the returned result and notify the user that customer support or manual resolution is required. Do not claim `FixUserShop` can repair unrelated WooCommerce plugins, store code, DNS, SSL, hosting, or other non-RevCent issues.


---
Document Parent Directory
* [Operations](https://revcent.com/documentation/markdown/mcp/operation/index.md) - AI/MCP details and overviews for operations available within the RevCent MCP.