# RevCent MCP Guide: `EditSite`

This guide is written for AI/MCP clients that need to edit RevCent Site configuration correctly and avoid confusing configuration updates with source-code changes.

---

## Primary Operation

```text
EditSite
```

**Title:** Edit A Site

**Purpose:** Edit supported configuration for an existing RevCent Site.

`EditSite` updates RevCent-managed Site configuration. It does not edit the actual code of the Site.

---

## Configuration vs Code

This distinction is critical for AI/MCP clients.

Use `EditSite` for supported Site configuration:

- Site name,
- Site description,
- Payment Profile,
- Product Group,
- optional PayPal Account,
- collaborator list.

Do not use `EditSite` for Site code or business logic.

`EditSite` does not edit:

- storefront source code,
- page templates,
- theme files,
- cart behavior,
- checkout business logic,
- offer or upsell flow,
- product presentation logic,
- custom ecommerce logic,
- copy, design, layout, or component behavior that lives in the Site repository.

Actual code and business-logic changes are made through the GitHub repository issued for the Site. Collaborators must accept the GitHub invite, clone the repository locally, and use AI-assisted development workflows to customize or update the ecommerce store.

The issued Site repository includes detailed documentation for developing, customizing, testing, and maintaining that specific Site. After cloning the repository locally, AI should read the repository documentation before making source-code, design, page behavior, cart behavior, checkout logic, offer flow, or custom business-logic changes.

These public RevCent markdown files intentionally do not include the full repository-level documentation. They explain the RevCent-facing configuration operation; the Site repository documentation explains the local development and customization workflow.

Recommended user-facing explanation:

```text
EditSite changes RevCent Site configuration. It does not change the storefront code. For code, design, and business-logic changes, use the Site repository that RevCent issued for the Site.
```

---

## When to Use

Good uses:

- rename a Site,
- update the Site description,
- change the Payment Profile used for Site credit card sales,
- change the Product Group used as the Site catalog source,
- add or change the optional PayPal Account for Site PayPal sales,
- replace the collaborator list for the Site repository.

Do not use `EditSite` when the user wants to change storefront design, checkout flow, cart logic, product page behavior, copy, styling, components, or custom code.

---

## Required Preparation

Before calling `EditSite`:

1. Identify the exact Site ID.
2. Call `GetSite` if the current configuration is unknown.
3. Confirm which configuration fields the user wants to change.
4. Retrieve exact IDs for Payment Profile, Product Group, or PayPal Account changes.
5. If editing collaborators, confirm the complete collaborator list because it replaces the existing list.
6. Confirm consequential changes before submitting.

Never guess Site IDs, Payment Profile IDs, Product Group IDs, PayPal Account IDs, or collaborator usernames.

---

## Input Schema

`EditSite` requires a path parameter and a JSON request body. Only include the properties you wish to modify.

```json
{
  "site_id": "XXXXXXXXXXXXXXXXXXXX",
  "name": "string",
  "description": "string",
  "paypal_account": "XXXXXXXXXXXXXXXXXXXX",
  "payment_profile": "XXXXXXXXXXXXXXXXXXXX",
  "product_group": "XXXXXXXXXXXXXXXXXXXX",
  "collaborators": [
    "github-username"
  ]
}
```

### Path Fields

| Field | Type | Required | Description |
|---|---:|---:|---|
| `site_id` | `string` | Yes | A 20-character Site ID. |

### Body Fields

| Field | Type | Required | Description |
|---|---:|---:|---|
| `name` | `string` | No | The Site name. Must be unique from other Site names. |
| `description` | `string` | No | The Site description. |
| `paypal_account` | `string` | No | A 20-character PayPal Account ID used for Site PayPal sales. Only necessary if the Site accepts PayPal payments. |
| `payment_profile` | `string` | No | A 20-character Payment Profile ID used for Site credit card sales. |
| `product_group` | `string` | No | A 20-character Product Group ID used as the Site catalog source. |
| `collaborators` | `array<string>` | No | Complete list of valid GitHub usernames that should have Site repository access. Replaces the existing collaborator list when provided. |

### Important Schema Rules

- Do not include unknown properties.
- Only include fields that should be modified.
- `payment_profile`, `product_group`, and `paypal_account` values must be 20-character RevCent IDs when provided.
- `collaborators` must contain at least one GitHub username when provided.
- The `collaborators` array replaces the existing collaborator list.
- If a prior collaborator is omitted from `collaborators`, that user will no longer have access to the Site repository.
- Newly added collaborators are invited through GitHub and must accept the invite before they can access or clone the repository.

---

## Output Schema

A successful `EditSite` response returns the Site ID.

```json
{
  "api_call_id": "XXXXXXXXXXXXXXXXXXXX",
  "api_call_unix": 1710000000,
  "code": 1,
  "site_id": "XXXXXXXXXXXXXXXXXXXX",
  "result": "string"
}
```

### Output Fields

| Field | Type | Description |
|---|---:|---|
| `api_call_id` | `string` | A 20-character API call ID. |
| `api_call_unix` | `integer` | Unix timestamp of when the API call was initiated. |
| `code` | `integer` | API response code. `1` means success. |
| `site_id` | `string` | The 20-character Site ID that was edited. |
| `result` | `string` | Human-readable operation result. |

---

## Example: Edit Name and Description

```json
{
  "site_id": "XXXXXXXXXXXXXXXXXXXX",
  "name": "Acme Spring Store",
  "description": "Customer-facing ecommerce Site for the Acme spring product collection."
}
```

---

## Example: Change Catalog Source

Use this when the Site should use a different Product Group as its catalog source.

```json
{
  "site_id": "XXXXXXXXXXXXXXXXXXXX",
  "product_group": "YYYYYYYYYYYYYYYYYYYY"
}
```

---

## Example: Replace Collaborators

Use this only after confirming the complete desired collaborator list.

```json
{
  "site_id": "XXXXXXXXXXXXXXXXXXXX",
  "collaborators": [
    "acme-developer",
    "acme-designer"
  ]
}
```

Remember: this replaces the existing collaborator list. Anyone not included may lose repository access.

---

## Recommended Follow-Up

After a successful `EditSite` call:

1. Call `GetSite`.
2. Verify the edited configuration fields.
3. Inspect `deployment.status`, `deployment.health`, `deployment.branches`, and `catalog` if the change affects Site behavior or catalog context.
4. Tell newly added collaborators to accept the GitHub invite before trying to access or clone the repository.
5. Tell AI to read the Site repository documentation after local clone and before code or business-logic edits.
6. Remind the user that code and business-logic changes require repository edits, not `EditSite`.

---

## Best Practices

1. Use `EditSite` only for supported configuration changes.
2. Use the Site repository for source-code, design, page behavior, cart behavior, checkout logic, offer flow, and custom business-logic changes.
3. Read the Site repository documentation before making repository changes.
4. Confirm consequential changes before submitting.
5. Treat collaborator updates carefully because the provided list replaces existing collaborators.
6. Encourage dev-branch testing before relying on main/live behavior.
7. Do not describe a configuration update as a code deployment.

---

## Final MCP Instruction

Use `EditSite` only when the user wants to edit supported RevCent Site configuration. For actual Site code, design, or business-logic changes, guide the user to the Site repository workflow.


---
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.