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

# Tools Reference

> Complete reference for all Studio MCP tools

# Tools Reference

All tools operate on the **live Studio editor** in real-time via WebSocket. Changes appear on the canvas instantly.

The server exposes tools in four categories: **Template**, **Node**, **Token**, and **Schema**.

<Note>
  No `pageId` parameter is needed for most tools — they operate on the **currently active page** in Studio. Multi-page tools like `list_pages` and `read_page` let you inspect other pages.
</Note>

***

## Template Tools

Read the template structure and browse pages.

### `read_template`

Read the currently loaded template from the live Studio editor. Returns the template name, category, active page, and a summary of all pages.

*No parameters.*

### `list_pages`

List all pages in the template with their IDs, names, paths, and types.

*No parameters.*

### `read_page`

Read a specific page's full document tree including root node, tokens, and assets.

| Parameter | Type   | Required | Description         |
| --------- | ------ | -------- | ------------------- |
| `pageId`  | string | Yes      | The page ID to read |

***

## Node Tools

Read, create, update, move, and delete nodes on the live canvas. Every mutation is **undo-able** in Studio (Ctrl+Z).

### `find_nodes`

Search for nodes in the current page by kind, prop name/value, or text content.

| Parameter   | Type   | Required | Description                                                           |
| ----------- | ------ | -------- | --------------------------------------------------------------------- |
| `kind`      | string | No       | Filter by node kind (e.g., `"Heading"`, `"Button"`, `"Layout.Stack"`) |
| `propName`  | string | No       | Filter by prop name existing on the node                              |
| `propValue` | string | No       | Filter by prop value (string match). Requires `propName`              |
| `text`      | string | No       | Search text content in string props                                   |

### `read_node`

Read a single node's full props, slots, and parent info.

| Parameter | Type   | Required | Description     |
| --------- | ------ | -------- | --------------- |
| `nodeId`  | string | Yes      | Node ID to read |

### `update_node`

Update one or more props on a node. Only pass the props you want to change — they're merged with existing props. **The canvas updates live.**

| Parameter | Type   | Required | Description                     |
| --------- | ------ | -------- | ------------------------------- |
| `nodeId`  | string | Yes      | Node ID to update               |
| `props`   | object | Yes      | Props to merge (partial update) |

### `add_node`

Add a new node to a parent's slot. The canvas updates live.

| Parameter  | Type   | Required | Description                                         |
| ---------- | ------ | -------- | --------------------------------------------------- |
| `parentId` | string | Yes      | Parent node ID                                      |
| `slotName` | string | Yes      | Slot name on the parent (e.g., `"children"`)        |
| `kind`     | string | Yes      | Node kind to create (e.g., `"Heading"`, `"Button"`) |
| `props`    | object | No       | Initial props                                       |
| `position` | number | No       | Insert position (0-based). Appends if omitted       |

### `remove_node`

Remove a node and all its children.

| Parameter | Type   | Required | Description       |
| --------- | ------ | -------- | ----------------- |
| `nodeId`  | string | Yes      | Node ID to remove |

### `move_node`

Move a node to a different parent, slot, or position.

| Parameter    | Type   | Required | Description                        |
| ------------ | ------ | -------- | ---------------------------------- |
| `nodeId`     | string | Yes      | Node to move                       |
| `toParentId` | string | Yes      | Target parent node ID              |
| `toSlotName` | string | Yes      | Target slot name                   |
| `toIndex`    | number | Yes      | Insert position in the target slot |

### `view_tree`

View the node tree hierarchy in a readable indented format. Great for understanding the layout.

| Parameter | Type   | Required | Description                                      |
| --------- | ------ | -------- | ------------------------------------------------ |
| `nodeId`  | string | No       | Start from this node (full page tree if omitted) |

### `duplicate_node`

Deep-clone a node (and all children) with new IDs, inserted right after the original.

| Parameter | Type   | Required | Description       |
| --------- | ------ | -------- | ----------------- |
| `nodeId`  | string | Yes      | Node to duplicate |

### `wrap_nodes`

Wrap one or more sibling nodes in a new layout container.

| Parameter    | Type      | Required | Description                                        |
| ------------ | --------- | -------- | -------------------------------------------------- |
| `nodeIds`    | string\[] | Yes      | Node IDs to wrap (must share the same parent slot) |
| `layoutKind` | string    | No       | Wrapper kind (default: `"Layout.Stack"`)           |

***

## Token Tools

Manage design tokens — colors, text content, translations, and other values that can be localized.

### `list_tokens`

List tokens in the current page with optional filters.

| Parameter     | Type   | Required | Description                                        |
| ------------- | ------ | -------- | -------------------------------------------------- |
| `scope`       | string | No       | Filter by scope: `global`, `brand`, `page`, `node` |
| `namePattern` | string | No       | Filter names containing this string                |
| `locale`      | string | No       | Filter by locale (e.g., `"fr-FR"`)                 |

### `update_token`

Update an existing token's value. Applied live in the editor.

| Parameter   | Type   | Required | Description                                             |
| ----------- | ------ | -------- | ------------------------------------------------------- |
| `tokenName` | string | Yes      | Token name (e.g., `"copy.headline"`, `"color.primary"`) |
| `value`     | any    | Yes      | New value                                               |
| `locale`    | string | No       | Locale to update (default locale if omitted)            |

### `add_token`

Add a new token to the current page.

| Parameter | Type   | Required | Description                                                  |
| --------- | ------ | -------- | ------------------------------------------------------------ |
| `name`    | string | Yes      | Token name                                                   |
| `value`   | any    | Yes      | Token value                                                  |
| `scope`   | string | No       | Scope: `global`, `brand`, `page`, `node` (default: `"page"`) |
| `locale`  | string | No       | Locale                                                       |
| `ownerId` | string | No       | Owner node ID (required for `"node"` scope)                  |

### `remove_token`

Remove a token from the current page.

| Parameter   | Type   | Required | Description                        |
| ----------- | ------ | -------- | ---------------------------------- |
| `tokenName` | string | Yes      | Token name to remove               |
| `locale`    | string | No       | Locale (default locale if omitted) |

***

## Schema Tools

Discover available component types and their schemas. These work offline — no Studio connection needed.

### `list_node_kinds`

List all available node kinds (component types) with descriptions and prop counts.

| Parameter  | Type   | Required | Description                                                |
| ---------- | ------ | -------- | ---------------------------------------------------------- |
| `category` | string | No       | Filter: `section`, `layout`, `content`, `commerce`, `form` |

### `describe_node_kind`

Get the full JSON Schema for a node kind: all props, types, slots, defaults, and editor groups.

| Parameter | Type   | Required | Description                                                       |
| --------- | ------ | -------- | ----------------------------------------------------------------- |
| `kind`    | string | Yes      | Node kind (e.g., `"Heading"`, `"Layout.Stack"`, `"OrderSummary"`) |

***

## MCP Resources

The server also exposes two **resources** agents can read:

| URI                         | Description                                    |
| --------------------------- | ---------------------------------------------- |
| `schema://node-definitions` | JSON Schema of all 49+ node kinds              |
| `template://current`        | Live template from the connected Studio editor |

***

## Endpoints

The HTTP server exposes these endpoints:

| Endpoint                       | Description                                      |
| ------------------------------ | ------------------------------------------------ |
| `GET /ws`                      | WebSocket — Studio editor connects here          |
| `GET /sse`                     | SSE — MCP agents connect here                    |
| `POST /messages?sessionId=...` | MCP message relay                                |
| `GET /health`                  | Health check (includes Studio connection status) |
| `GET /`                        | Server info                                      |
