> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ecomwize.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Tools

> Every MCP tool as a REST endpoint: same capabilities, permissions and limits.

The tools endpoints give the API everything the EcomWize MCP server can do. Each MCP tool is one REST call, with the same arguments, the same permissions and the same rate limits. Whatever works in Claude, ChatGPT or Cursor works over the API.

## List the tools you can call

```bash theme={null}
curl https://app.ecomwize.io/api/v1/tools \
  -H "Authorization: Bearer ew_live_YOUR_KEY"
```

Returns `{ "tools": [ { "name", "description", "inputSchema", "annotations" } ] }` with only the tools your key may use. Read-only keys get the read tools.

## Call a tool

Send the tool arguments as a JSON object:

```bash theme={null}
curl -X POST https://app.ecomwize.io/api/v1/tools/get_page \
  -H "Authorization: Bearer ew_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"page_id": "PAGE_ID"}'
```

A successful call returns `{ "result": ... }`. Errors return `{ "error", "message", "status" }`:

| Status | Meaning |
| - | - |
| `400` | Invalid arguments, or the tool could not run (the message says why) |
| `401` | Missing or invalid API key |
| `403` | Your key lacks the permission this tool needs (use a full access key) |
| `404` | Unknown tool name |
| `413` | Body larger than 512KB |
| `429` | Rate limit reached, try again in a minute |

## Rate limits

Limits are shared per workspace across the API and MCP: 120 read calls, 30 edit or publish calls and 10 AI calls per minute.

> [!NOTE]
>
> Page writes are safe to run while someone edits in the builder: a write that would overwrite newer changes is refused, and every write saves a version you can restore from History.

## Read tools

Look up pages, section code, the section library, templates, brand kits, stores and products. Needs any key.

### `list_pages`

List the workspace pages (newest first): id, title, status, page kind, section count, whether it is a code page, and the builder link.

| Argument | Type | Required | Description |
| - | - | - | - |
| `store_id` | string | No | Only pages of this connected store. |
| `limit` | number | No | Max pages (default 50, max 200). |

### `get_page`

Read a page: settings, brand kit, linked product, and every section with its id, name, editable text slots (t0, t1...) and image slots (i0, i1...). Returns sections\_hash for safe writes. Call get\_section\_code for a section's full code.

| Argument | Type | Required | Description |
| - | - | - | - |
| `page_id` | string | Yes | Page id (from list\_pages). |

### `get_section_code`

Max plan only. The full Liquid + HTML + Tailwind code (and optional scoped CSS) of one section. Edit it, then send it back with update\_section.

| Argument | Type | Required | Description |
| - | - | - | - |
| `page_id` | string | Yes | Page id (from list\_pages). |
| `section_id` | string | Yes | Section id (from get\_page). |

### `list_section_library`

The proven section designs (hero, benefits, reviews, FAQ, product buy box...): key, name, category, description. Add one with add\_section.

| Argument | Type | Required | Description |
| - | - | - | - |
| `category` | string | No | Optional category filter, e.g. hero, testimonial, faq. |

### `get_library_section`

Max plan only. The code of a library section, to adapt before adding it with add\_section (code).

| Argument | Type | Required | Description |
| - | - | - | - |
| `key` | string | Yes | Library key from list\_section\_library, e.g. hero01. |

### `list_templates`

Ready-made page templates (landing pages, product pages, listicles...): id, name, category. Use with create\_page or generate\_page.

| Argument | Type | Required | Description |
| - | - | - | - |
| `category` | string | No | |

### `list_brand_kits`

The workspace brand kits (colors, fonts, buttons + brand context) and the public preset looks.

No arguments.

### `get_brand_kit`

All fields of one brand kit (design tokens and brand context).

| Argument | Type | Required | Description |
| - | - | - | - |
| `brand_kit_id` | string | Yes | |

### `list_stores`

Connected Shopify stores (id, domain, name).

No arguments.

### `list_products`

Products of a connected Shopify store (id, title, handle, image, price).

| Argument | Type | Required | Description |
| - | - | - | - |
| `store_id` | string | Yes | |
| `query` | string | No | Optional title filter. |

## Edit tools

Change pages, sections, settings and brand kits. No credits. Needs a key with full access.

### `create_page`

Create a draft page: blank, or a copy of a template (keeps the template design). Optionally attach a brand kit and a store product. To have AI write it for a product, use generate\_page instead.

| Argument | Type | Required | Description |
| - | - | - | - |
| `title` | string | Yes | |
| `template_id` | string | No | |
| `brand_kit_id` | string | No | |
| `store_id` | string | No | |
| `product_id` | string | No | Shopify product id of that store. |
| `handle` | string | No | |

### `add_section`

Add a section: a library design (library\_key, every plan) or your own code (source + optional css, name; Max plan). Placed at the end unless after\_section\_id or position is given. Code is sanitized, rendered and compiled before saving; errors come back to fix.

| Argument | Type | Required | Description |
| - | - | - | - |
| `page_id` | string | Yes | Page id (from list\_pages). |
| `library_key` | string | No | |
| `source` | string | No | |
| `css` | string | No | |
| `name` | string | No | |
| `after_section_id` | string | No | Insert after this section, or "start". |
| `expected_hash` | string | No | sections\_hash from your last get\_page / write. If the page changed since (e.g. edited in the builder), the write is refused so nothing is overwritten. |

### `update_section`

Max plan only. Change a section's code: either the full new source, or patches (exact find/replace, first match each). Optional css and name. Validated (sanitize, Liquid render, Tailwind) before saving; a version is kept so it can be restored.

| Argument | Type | Required | Description |
| - | - | - | - |
| `page_id` | string | Yes | Page id (from list\_pages). |
| `section_id` | string | Yes | Section id (from get\_page). |
| `source` | string | No | |
| `patches` | array of object | No | |
| `css` | string | No | |
| `name` | string | No | |
| `expected_hash` | string | No | sections\_hash from your last get\_page / write. If the page changed since (e.g. edited in the builder), the write is refused so nothing is overwritten. |

### `edit_text`

Replace text in a section by slot key (t0, t1... from get\_page). Plain text only (HTML is escaped). Safest way to rewrite copy.

| Argument | Type | Required | Description |
| - | - | - | - |
| `page_id` | string | Yes | Page id (from list\_pages). |
| `section_id` | string | Yes | Section id (from get\_page). |
| `texts` | object | Yes | e.g. \{ "t0": "New headline", "t2": "New button" } |
| `expected_hash` | string | No | sections\_hash from your last get\_page / write. If the page changed since (e.g. edited in the builder), the write is refused so nothing is overwritten. |

### `replace_image`

Swap images in a section by slot key (i0, i1... from get\_page) with public https image URLs.

| Argument | Type | Required | Description |
| - | - | - | - |
| `page_id` | string | Yes | Page id (from list\_pages). |
| `section_id` | string | Yes | Section id (from get\_page). |
| `images` | object | Yes | e.g. \{ "i0": \{ "url": "https\://...", "alt": "..." } } |
| `expected_hash` | string | No | sections\_hash from your last get\_page / write. If the page changed since (e.g. edited in the builder), the write is refused so nothing is overwritten. |

### `remove_section`

Delete a section (a version is kept, restorable from the builder History).

| Argument | Type | Required | Description |
| - | - | - | - |
| `page_id` | string | Yes | Page id (from list\_pages). |
| `section_id` | string | Yes | Section id (from get\_page). |
| `expected_hash` | string | No | sections\_hash from your last get\_page / write. If the page changed since (e.g. edited in the builder), the write is refused so nothing is overwritten. |

### `move_section`

Move a section to a new position (0 = first) or right after another section.

| Argument | Type | Required | Description |
| - | - | - | - |
| `page_id` | string | Yes | Page id (from list\_pages). |
| `section_id` | string | Yes | Section id (from get\_page). |
| `position` | number | No | |
| `after_section_id` | string | No | |
| `expected_hash` | string | No | sections\_hash from your last get\_page / write. If the page changed since (e.g. edited in the builder), the write is refused so nothing is overwritten. |

### `update_page_settings`

Page title, URL handle, SEO description and page background color.

| Argument | Type | Required | Description |
| - | - | - | - |
| `page_id` | string | Yes | Page id (from list\_pages). |
| `title` | string | No | |
| `handle` | string | No | |
| `meta_description` | string | No | |
| `page_background` | string | No | Hex color, e.g. #FFF8F2 |

### `set_brand_kit`

Style a page with a brand kit (its colors, fonts and buttons apply to every section).

| Argument | Type | Required | Description |
| - | - | - | - |
| `page_id` | string | Yes | Page id (from list\_pages). |
| `brand_kit_id` | string | Yes | |

### `create_brand_kit`

Create a brand kit by hand: name plus design fields (see get\_brand\_kit for names, e.g. brand\_primary, btn\_color, font\_family\_heading) and optional context (store\_name, tagline, niche, audience, about).

| Argument | Type | Required | Description |
| - | - | - | - |
| `name` | string | Yes | |
| `fields` | object | No | |
| `context` | object | No | |

### `update_brand_kit`

Change fields of one of the workspace brand kits.

| Argument | Type | Required | Description |
| - | - | - | - |
| `brand_kit_id` | string | Yes | |
| `name` | string | No | |
| `fields` | object | No | |
| `context` | object | No | |

### `fill_page_sections`

Classic pages only (sections that are not code). Update content fields keyed section\_1, section\_2... For code pages use edit\_text / update\_section.

| Argument | Type | Required | Description |
| - | - | - | - |
| `page_id` | string | Yes | Page id (from list\_pages). |
| `sections` | object | Yes | |

### `duplicate_page`

Duplicate a page (any kind) as a new draft, within the plan page limit.

| Argument | Type | Required | Description |
| - | - | - | - |
| `page_id` | string | Yes | Page id (from list\_pages). |
| `title` | string | No | |

## Generate with AI tools

AI work that spends your workspace credits. Needs a key with full access.

### `generate_page`

AI writes a complete page for a product in about 30 seconds: from the section library for the page type, or by filling a template. Creates the page unless page\_id (an empty page) is given. Costs 50 credits, plus 10 per image when generate\_images is true.

| Argument | Type | Required | Description |
| - | - | - | - |
| `prompt` | string | Yes | What to build, for whom, the angle and tone. |
| `page_type` | string: `landing page`, `product page`, `listicle`, `advertorial`, `homepage`, `quiz` | Yes | |
| `title` | string | No | |
| `page_id` | string | No | |
| `template_id` | string | No | |
| `keep_template_style` | boolean | No | With template\_id: keep the template design (default true) or restyle it to the brand kit. |
| `brand_kit_id` | string | No | |
| `store_id` | string | No | |
| `product_id` | string | No | |
| `generate_images` | boolean | No | |

### `generate_brand_kit`

AI creates a brand kit from a description ("calm, premium skincare, sage green") or from a website URL (reads its real colors and fonts). Saves it in the workspace. Costs 1 credit.

| Argument | Type | Required | Description |
| - | - | - | - |
| `description` | string | No | |
| `url` | string | No | |
| `name` | string | No | |

## Publish tools

Publish pages to your connected Shopify store. Needs a key with full access.

### `publish_page`

Publish (or republish) a page to its connected Shopify store. Returns the live URL.

| Argument | Type | Required | Description |
| - | - | - | - |
| `page_id` | string | Yes | Page id (from list\_pages). |
| `store_id` | string | No | |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.