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

# MCP Tools Reference

> Input schema, output shape, and examples for all 22 Flowstep MCP tools.

On success, every tool except `get-screen-image` returns its result twice: as `structuredContent` (validated against the tool’s published output schema) and as the same object serialized into a text block, `{ type: "text", text: "<json-string>" }`, for clients that don’t read structured content. `get-screen-image` returns only an MCP image block: `{ type: "image", data: "<base64>", mimeType: "image/png" }`.

On failure, `isError: true` is set and the text block contains a short error message. Errors you can act on — a name mismatch on delete, an invalid Figma link, an attachment problem, or a generation timeout — explain what to fix. Other failures return a generic message such as `Failed to list files`.

> [!NOTE]
>
> **Pricing:** the three [AI design tools](#ai-design-tools) — `ai-design-screens`, `ai-generate-screen-variant`, and `ai-edit-screen-variant` — draw on the same message allowance as the Flowstep app. All other tools are free. See [Usage limits](https://flowstep.ai/docs/mcp/usage-limits.md).

Each tool also publishes MCP annotations so your client knows what it does. `delete-file`, `delete-screen`, `delete-file-instructions`, `replace-screen-jsx`, `ai-design-screens`, and `ai-edit-screen-variant` are marked destructive because they remove or overwrite existing content.

***

## File tools

### `list-files`

List metadata for your Flowstep files. Call this first to check whether a relevant file already exists. It returns no screen content — use `get-screen-image` or `get-screen-jsx` for that.

**Input**

| Parameter | Type | Default | Description |
| - | - | - | - |
| `orderByCreation` | `boolean` | `true` | Sort newest first by `created_at` (`true`) or by `updated_at` (`false`). Use `false` to find recently edited files |
| `limit` | `integer` (1–100) | `20` | Maximum files returned. A full page may mean more files exist |
| `offset` | `integer` (≥0) | `0` | Files to skip. The next page is `offset + limit` |

**Output** — `{ files }`.

```json
{
  "files": [
    {
      "id": "5c2170f0-5b09-4a5a-ba7a-4d5c2cfb07e0",
      "name": "Dashboard redesign",
      "created_at": "2026-04-30T15:02:13.120152+00:00",
      "updated_at": "2026-04-30T15:02:13.120152+00:00",
      "organisation_id": "0b7f3c9e-2d4a-4f1b-9a5e-6c8d7e1f2a3b",
      "shared_with_me": false,
      "owner": true,
      "url": "https://app.flowstep.ai/file?activeFileId=5c2170f0-5b09-4a5a-ba7a-4d5c2cfb07e0"
    }
  ]
}
```

* `owner` — `true` if you created the file.
* `shared_with_me` — `true` if the file was shared with you directly, not only through your organization.
* `url` — opens the file in the Flowstep editor.

***

### `get-file`

Get metadata for a single file. File content is intentionally omitted — use `get-screen-image` or `get-screen-jsx` to inspect screens, and `get-file-instructions` to retrieve the file’s instructions. If you have a pending invite to the file, calling `get-file` accepts it.

**Input**

| Parameter | Type | Description |
| - | - | - |
| `id` | `uuid` | File ID |

**Output** — `{ file, user_access_level }`.

```json
{
  "file": {
    "id": "5c2170f0-5b09-4a5a-ba7a-4d5c2cfb07e0",
    "name": "Dashboard redesign",
    "created_at": "2026-04-30T15:02:13.120152+00:00",
    "updated_at": "2026-04-30T15:02:13.120152+00:00",
    "project_id": "81cb84d6-c69f-492c-a895-7421b60d1a6d",
    "access_level": "private",
    "visibility": "private",
    "owner": true,
    "url": "https://app.flowstep.ai/file?activeFileId=5c2170f0-5b09-4a5a-ba7a-4d5c2cfb07e0"
  },
  "user_access_level": "write"
}
```

* `access_level` — `private`, `read`, or `write`.
* `visibility` — `private`, `member`, or `public`.
* `user_access_level` — your access to the file: `read` or `write`.

***

### `create-file`

Create a blank Flowstep file with no screens. To create a file and generate screens in one step, call `ai-design-screens` without a `fileId` instead. Use `create-file` for code-first workflows, followed by `add-screen-jsx`.

**Input**

| Parameter | Type | Description |
| - | - | - |
| `name` | `string` (min 1) | Display name of the new file |

**Output** — `{ file, user_access_level }`, in the same shape as `get-file`. `owner` is always `true` and `user_access_level` is always `write`.

Use the returned `file.id` as `fileId` in subsequent tool calls.

***

### `update-file`

Rename a file.

**Input**

| Parameter | Type | Description |
| - | - | - |
| `id` | `uuid` | File ID |
| `name` | `string` (min 1) | New display name |

**Output** — `{ file, user_access_level }`, in the same shape as `get-file`.

***

### `delete-file`

Permanently delete a file. The `name` you pass is checked against the file’s current display name before deletion — if it doesn’t match, the deletion is aborted. This prevents accidentally deleting the wrong file. Agents are instructed to confirm with you first.

**Input**

| Parameter | Type | Description |
| - | - | - |
| `id` | `uuid` | File ID |
| `name` | `string` | Current display name of the file — must match or deletion is aborted |

**Output** — `{ "deleted": true }`

> [!WARNING]
>
> This is irreversible. All screens in the file are deleted.

***

## Screen tools

### `list-screens`

List the screens in a file, in canvas order. Call this after `list-files` to see what’s already in a file. Use the returned `screenId` values with the other screen tools and the AI design tools.

**Input**

| Parameter | Type | Description |
| - | - | - |
| `fileId` | `uuid` | File ID |

**Output** — `{ screens }`.

```json
{
  "screens": [
    {
      "screenId": "3f9e6eb6-5525-4383-9375-67e0bd762dbe",
      "name": "Mobile login screen",
      "prompt": "Generate a simple mobile login screen with email and password fields and a sign in button",
      "fidelity": "ui"
    }
  ]
}
```

* `prompt` — the last generation prompt for the screen, or an empty string if it was never generated (for example, a screen added with `add-screen-jsx`).
* `fidelity` — `lofi`, `hifi`, or `ui`.

***

### `get-screen-image`

Render a screen to PNG and return it as an inline image. Requires a client that supports image content blocks. Call it once for each `screenId` returned by an AI design tool, `add-screen-jsx`, `replace-screen-jsx`, or `import-figma`.

**Input**

| Parameter | Type | Description |
| - | - | - |
| `fileId` | `uuid` | File ID |
| `screenId` | `uuid` | A `screenId` from `list-screens` or from the `screenIds` array returned by a design tool |

**Output** — MCP image content block (`image/png`). `data` is standard base64 of the PNG bytes, not a data URI. There’s no `structuredContent` for this tool.

***

### `get-screen-jsx`

Get a screen as JSX, plus its metadata — so you can build from it in your codebase, or edit it and write it back with `replace-screen-jsx`. Use `get-screen-image` for a visual preview instead.

**Input**

| Parameter | Type | Default | Description |
| - | - | - | - |
| `fileId` | `uuid` | — | File ID |
| `screenId` | `uuid` | — | A `screenId` from `list-screens` or from the `screenIds` array returned by a design tool |
| `includeIds` | `boolean` | `false` | Include a `data-id` attribute on elements in `jsx`. Use it when you need element ids to pass as `elementIds` to `ai-design-screens`, either to edit in place or as visual reference |

**Output** — `{ fileId, screenId, name, prompt, fidelity, screenType, colorTheme, jsx, fragments }`.

```json
{
  "fileId": "5c2170f0-5b09-4a5a-ba7a-4d5c2cfb07e0",
  "screenId": "c13d3707-0efe-49f5-b6cb-0ca5ac5223d0",
  "name": "World clock",
  "prompt": "A world clock screen with a city search and alert button",
  "fidelity": "ui",
  "screenType": "iphone-x-vertical",
  "colorTheme": "blue",
  "jsx": "<div className=\"bg-white text-zinc-950 w-full h-fit\">\n  <div className=\"flex p-6 flex-col gap-6\">\n    …\n  </div>\n</div>",
  "fragments": []
}
```

* `jsx` — markup only. `data-id` attributes are included only when `includeIds` is `true`.
* `prompt` — the last generation prompt, or an empty string if the screen was never generated.
* `fragments` — shared chrome stored on the screen, such as a nav bar, header, or logo, as `{ purpose, markup }` objects. Empty when there are none. Pass them back to `replace-screen-jsx` to keep or update them.

See [Screen field values](#screen-field-values) for the `fidelity`, `screenType`, and `colorTheme` values.

***

### `add-screen-jsx`

Add a new screen to a file from JSX you’ve written. This is the code-first path and is free — use `ai-design-screens` when you want Flowstep’s AI to design the screen. `add-screen-jsx` always creates a new screen: to overwrite an existing one, use `replace-screen-jsx`.

To show an image you’ve uploaded, see [Images in JSX](#images-in-jsx).

When the new screen is based on an existing one, start from `get-screen-jsx` (without `includeIds`) for `name`, `fidelity`, `screenType`, `colorTheme`, and `jsx`, then change whatever should differ.

**Input**

| Parameter | Type | Default | Description |
| - | - | - | - |
| `fileId` | `uuid` | — | File ID |
| `name` | `string` (1–100 chars) | — | Optional display name. Omit it to auto-name the screen `Screen N` |
| `fidelity` | `string` | `"ui"` | Screen fidelity |
| `screenType` | `string` | — | **Required** — the device or viewport the screen is designed for |
| `colorTheme` | `string` | `"default"` | Color theme |
| `jsx` | `string` | — | JSX markup only. Any `data-id` attributes are ignored — the new screen gets new element ids |

**Output** — `{ fileId, screenId }`. Call `get-screen-image` with `screenId` to view the result.

```json
{
  "fileId": "5c2170f0-5b09-4a5a-ba7a-4d5c2cfb07e0",
  "screenId": "3f9e6eb6-5525-4383-9375-67e0bd762dbf"
}
```

***

### `replace-screen-jsx`

Overwrite an existing screen with JSX you’ve written. The screen keeps its `screenId` and its position on the canvas; nested elements get new ids. This is the code-first path and is free — use `ai-design-screens` or `ai-edit-screen-variant` for AI changes, and `add-screen-jsx` to create a new screen instead.

Start from `get-screen-jsx` (without `includeIds`), then change whatever should differ. To show an image you’ve uploaded, see [Images in JSX](#images-in-jsx).

**Input**

| Parameter | Type | Description |
| - | - | - |
| `fileId` | `uuid` | File ID |
| `screenId` | `uuid` | The screen to overwrite |
| `jsx` | `string` | JSX markup only. Any `data-id` attributes are ignored |
| `name` | `string` (1–100 chars) | Optional. Omit to keep the current name |
| `fidelity` | `string` | Optional. Omit to keep the current fidelity |
| `screenType` | `string` | Optional. Omit to keep the current screen type |
| `colorTheme` | `string` | Optional. Omit to keep the current color theme |
| `fragments` | `{ purpose, markup }[]` | Optional shared chrome from `get-screen-jsx`. Omit to keep the current fragments, or pass `[]` to clear them |

**Output** — `{ fileId, screenId }`. Call `get-screen-image` with `screenId` to view the result.

> [!WARNING]
>
> This replaces the screen’s content in place.

***

### `rename-screen`

Rename a screen’s canvas label — the name shown by `list-screens` and in the editor. This changes the label only, not the screen’s layout, size, or content — use `ai-design-screens` for those.

**Input**

| Parameter | Type | Description |
| - | - | - |
| `fileId` | `uuid` | File ID |
| `screenId` | `uuid` | The `screenId` returned by `list-screens` |
| `name` | `string` (1–100 chars) | New screen name. Leading and trailing whitespace is trimmed |

**Output** — `{ screenId, name }`.

```json
{ "screenId": "3f9e6eb6-5525-4383-9375-67e0bd762dbe", "name": "Checkout — empty cart" }
```

***

### `delete-screen`

Permanently delete a screen from a file. The `name` you pass is checked against the screen’s current display name — if it doesn’t match, the deletion is aborted. Agents are instructed to confirm with you first.

**Input**

| Parameter | Type | Description |
| - | - | - |
| `fileId` | `uuid` | File ID |
| `screenId` | `uuid` | The screen to delete |
| `name` | `string` | Current display name of the screen — must match or deletion is aborted |

**Output** — `{ "deleted": true }`

***

### Images in JSX

`add-screen-jsx` and `replace-screen-jsx` accept images in an `img` `src`, or as a background in `className` with `bg-[url(...)]`. Write `alt` text, and size each image for its purpose.

To place an image of your own:

1. Upload it with [`upload-attachment`](#upload-attachment) in Mode A (`mimeType` + `fileName`) and run the returned `uploadCommand`.
2. If the response’s `type` is `"image"`, paste its `assetUrl` exactly as returned into `img src` or `bg-[url(assetUrl)]`.

Leave every other image URL exactly as `get-screen-jsx` returned it. Don’t put `path`, `signedUrl`, or `uploadCommand` in `src`.

```jsx
<img src="ASSET_URL" alt="Team photo" className="w-full h-48 object-cover rounded-lg" />
```

***

### Screen field values

`get-screen-jsx` returns, and `add-screen-jsx` and `replace-screen-jsx` accept, these values:

| Field | Values |
| - | - |
| `fidelity` | `lofi`, `hifi`, `ui` |
| `screenType` | `web`, `desktop`, `desktop-large`, `desktop-medium`, `desktop-small`, `tablet`, `ipad-tablet-horizontal`, `ipad-tablet-vertical`, `android-tablet-horizontal`, `android-tablet-vertical`, `mobile_ios`, `mobile_android`, `iphone-vertical`, `iphone-horizontal`, `iphone-x-vertical`, `iphone-x-horizontal`, `android-vertical`, `android-horizontal`, `android-small-vertical`, `android-small-horizontal` |
| `colorTheme` | `default`, `defaultDark`, `blue`, `blueDark`, `ice`, `iceDark`, `grayscale`, `grayscaleDark`, `green`, `greenDark`, `orange`, `orangeDark`, `red`, `redDark`, `rose`, `roseDark`, `violet`, `violetDark`, `yellow`, `yellowDark` |

***

## File instructions tools

File instructions are plain markdown stored on a file. When set, they’re sent as context with every AI generation and edit for that file. See [File instructions](https://flowstep.ai/docs/design-guidelines.md).

### `get-file-instructions`

Get the file instructions attached to a file.

**Input**

| Parameter | Type | Description |
| - | - | - |
| `fileId` | `uuid` | File ID |

**Output** — `{ instructions }`.

```json
{
  "instructions": "Prices are always in euros.\nNavigation sits in a left sidebar, never a top bar."
}
```

`instructions` is `null` if none have been set.

***

### `update-file-instructions`

Set or replace the file instructions for a file. Pass the instructions as a plain markdown string — not an object or JSON. If you’re reading from a file, pass that file’s text. Colors, rounding, and fonts come from the file’s theme; instructions that name them are applied through the theme’s tokens.

**Input**

| Parameter | Type | Description |
| - | - | - |
| `fileId` | `uuid` | File ID |
| `instructions` | `string` (1–50,000 chars) | Raw markdown text. Must be a plain string — not JSON-encoded |

**Output** — `{ "updated": true }`

***

### `delete-file-instructions`

Clear the file instructions for a file. Deleting instructions that don’t exist is a no-op.

**Input**

| Parameter | Type | Description |
| - | - | - |
| `fileId` | `uuid` | File ID |

**Output** — `{ "deleted": true }`

***

## Chat tools

### `get-chat-history`

Get the design conversation associated with a file — the file’s Flowstep chat, not your MCP client’s conversation. Use it to resume earlier work on the file.

**Input**

| Parameter | Type | Description |
| - | - | - |
| `fileId` | `uuid` | File ID |

**Output** — `{ messages }`. `messages` is empty when you have no design conversation on the file. Each message has a `type` (`"request"` or `"response"`), an `author` (`"human"` or `"ai"`), and a `content_type`. Response messages use `"text"`, `"summary"`, or `"followup"`.

```json
{
  "messages": [
    {
      "id": "453f593d-2380-425b-ba29-127db08d6a8e",
      "type": "request",
      "status": "success",
      "content": "Generate a simple mobile login screen with email and password fields",
      "author": "human",
      "content_type": "text",
      "sequence": 1,
      "targets": [],
      "attachments": []
    },
    {
      "id": "d860186b-82d5-4bd1-8e8e-8ba5377a14bf",
      "type": "response",
      "status": "success",
      "content": "Generated a mobile login screen with email and password input fields, a sign in button, and a sign up link.",
      "author": "ai",
      "content_type": "summary",
      "sequence": 7,
      "request_message_id": "453f593d-2380-425b-ba29-127db08d6a8e",
      "targets": [{ "target_id": "3f9e6eb6-5525-4383-9375-67e0bd762dbe" }]
    }
  ]
}
```

***

## Attachment tools

### `upload-attachment`

Upload a reference file to use as an attachment in `ai-design-screens`, or an image to place in your own JSX with `add-screen-jsx` or `replace-screen-jsx`. `ai-generate-screen-variant` and `ai-edit-screen-variant` don’t take attachments. File bytes never pass through the model, and the server never fetches URLs on your behalf. To reference a webpage, include its URL in the `message` of `ai-design-screens` instead.

There are two modes — use exactly one, and don’t combine them.

**Mode A — files and images (`mimeType` + `fileName`)**

A required three-step flow for any image, PDF, or larger text file:

1. Call `upload-attachment` with `mimeType` and `fileName` only (for example `image/png` and `dog.png`). The response is a *prepared* upload, not a stored file:

   ```json
   {
     "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
     "path": "attachments/a1b2c3d4-e5f6-7890-abcd-ef1234567890",
     "assetUrl": "https://…",
     "type": "image",
     "mimeType": "image/png",
     "signedUrl": "https://…",
     "uploadCommand": "curl -sS -f -X PUT '…' -H 'Content-Type: image/png' -H 'x-metadata: …' --data-binary @LOCAL_FILE_PATH",
     "nextStep": "…"
   }
   ```
2. Replace `LOCAL_FILE_PATH` in `uploadCommand` with the absolute path to your file and run that exact command in your shell — it must exit 0. The token in `signedUrl` authorizes only this single upload. **Skipping this step leaves storage empty and the design tool fails its preflight check.**
3. Pass only `{ id, path, type }` into the `attachments` array of `ai-design-screens` — not `signedUrl`, `uploadCommand`, or `nextStep`. To place an image in your own JSX instead, put `assetUrl` in the `img src` or `bg-[url(...)]` of the JSX you pass to `add-screen-jsx` or `replace-screen-jsx`. See [Images in JSX](#images-in-jsx).

To attach a remote file, download it to a local path yourself first (for example with `curl`), then follow the same three steps. Never pass a URL to `upload-attachment`.

| Parameter | Type | Description |
| - | - | - |
| `mimeType` | enum | File MIME type. One of `image/jpeg`, `image/png`, `image/webp`, `image/gif`, `application/pdf`, `text/markdown`, `text/plain`, `text/javascript`. Use `text/javascript` for `.jsx`, `.tsx`, `.js`, `.ts` files |
| `fileName` | `string` (min 1) | Original filename with extension, for example `cat.png` or `design.md` |

**Mode B — short text (`text` + `mimeType`)**

Upload text that’s already in context — no shell command needed. The response is ready to use directly:

```json
{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "path": "attachments/a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "assetUrl": "https://…",
  "type": "document",
  "mimeType": "text/plain"
}
```

| Parameter | Type | Description |
| - | - | - |
| `text` | `string` (max 64,000 chars) | Raw text content. Text files only — don’t use for images or PDFs. Longer than 64,000 characters? Use Mode A instead |
| `mimeType` | enum | One of `text/markdown`, `text/plain`, `text/javascript` |

Pass the resulting `{ id, path, type }` into the `attachments` array of `ai-design-screens`.

Images can be up to **20 MB**; documents (PDF, text, and code files) up to **3 MB**. PDFs are capped at 100 pages. A file over its limit fails the upload with HTTP 413 and isn’t stored.

**Output** — `{ id, path, assetUrl, type, mimeType, signedUrl?, uploadCommand?, nextStep? }`.

* `type` — `"image"` for image files and `"document"` for PDFs and text files.
* `assetUrl` — the uploaded file’s URL, returned in both modes. Use it in JSX for `add-screen-jsx` or `replace-screen-jsx` only when `type` is `"image"`, and only after the Mode A `uploadCommand` has run.
* `signedUrl`, `uploadCommand`, `nextStep` — set only in Mode A. Don’t pass them into design tools.

***

## Figma tools

### `import-figma`

Import a Figma frame into a Flowstep file as editable elements on its canvas. Each import adds a new screen — importing the same frame twice gives you two screens, so delete the old one with `delete-screen` if you meant to replace it. The file’s organization must have Figma connected in Flowstep settings.

**Input**

| Parameter | Type | Description |
| - | - | - |
| `fileId` | `uuid` | The Flowstep file to import the frame into. This is not the Figma file key in `figmaUrl` |
| `figmaUrl` | `string` | Link to a specific Figma frame, with a `node-id`. In Figma, right-click the frame and choose **Copy/Paste as** → **Copy link to selection**. A link to a page imports all top-level frames on that page (capped at 20 frames over MCP) |

**Output** — `{ fileId, screenId, frameCount? }`. `screenId` is the imported screen — pass it to `get-screen-image` to view the result. When a page URL imports multiple frames, `screenId` is `null` and `frameCount` is returned instead; call `list-screens`, then `get-screen-image` for each new screen.

```json
{
  "fileId": "5c2170f0-5b09-4a5a-ba7a-4d5c2cfb07e0",
  "screenId": "3f9e6eb6-5525-4383-9375-67e0bd762dbe"
}
```

***

## Plan and billing tools

### `get-plan-details`

Get your organization’s Flowstep plan, subscription status, usage, and remaining quota. Takes no input — the organization is resolved from the signed-in user. Use it to check your allowance before calling the AI design tools.

**Output** — `{ plan, subscription, limits, usage, remaining }`.

| Field | Description |
| - | - |
| `plan` | `{ name, code, type }`. `type` is `"free"` or `"paid"` |
| `subscription` | `{ isPaid, isTrial, startDate, endDate, trialDaysRemaining }` |
| `limits` | Per-feature limits, keyed by feature (for example `messages`). Each has optional `daily` and `monthly` objects with `max` and `warn` values, plus an `unlimited` flag |
| `usage` | Per-feature usage so far, as `{ daily, monthly }` |
| `remaining` | Per-feature quota left, as `{ daily, monthly }`. Omitted for unlimited features |

Limits vary by plan — see [Pricing](https://flowstep.ai/pricing) and [Usage limits](https://flowstep.ai/docs/mcp/usage-limits.md).

***

## AI design tools

These three tools design from a description or a preset — they never take or reuse JSX. Each call draws on the same message allowance as the Flowstep app, and blocks until generation completes or times out (180 seconds).

| Tool | Use it to |
| - | - |
| `ai-design-screens` | Generate new screens, change existing screens in place, or both, from a free-form description |
| `ai-generate-screen-variant` | Add a next-step, error or empty state, or platform variant of one existing screen |
| `ai-edit-screen-variant` | Apply an edit or redesign preset to one whole existing screen |

All three return `{ status, fileId, screenIds }`. Call `get-screen-image` once for each `screenId` to see the result.

***

### `ai-design-screens`

Generate one or more new screens, change existing screens in place, or both in one call, from a text description — new flows, theming, copy, layout, or coordinated changes across several screens. This is the same design agent as the chat in the Flowstep editor: it decides from your `message` and `elementIds` what to build and what to change.

Omit `fileId` to start a new file; pass `fileId` to work in an existing one. If the request could apply to a file you already have, your agent should check `list-files` and `list-screens` first. For a next-step, error or empty state, or platform variant of one screen, use `ai-generate-screen-variant`. For a preset edit or redesign of one screen, use `ai-edit-screen-variant`. If you already have JSX, use `add-screen-jsx` or `replace-screen-jsx` instead.

**Input**

| Parameter | Type | Default | Description |
| - | - | - | - |
| `fileId` | `uuid` | — | Target file. Omit to create a new file. Required when `elementIds` is set |
| `message` | `string` | — | Description of the screens to generate and/or the changes to make. When you pass `elementIds`, say whether to edit them or use them as reference. Include any webpage URLs you want Flowstep to reference here |
| `elementIds` | `uuid[]` | `[]` | Optional `screenId`s from `list-screens` and/or element `data-id`s from `get-screen-jsx` (with `includeIds`), like a selection in the editor. They can be edited in place or used as visual reference for new screens. A `screenId` targets the whole screen |
| `attachments` | `{ id, path, type }[]` (max 5) | `[]` | Files from `upload-attachment` — images, PDFs, or code and text files. Don’t inline file contents in the message |

**Example** — edit one screen and add another in a single call:

```json
{
  "fileId": "5c2170f0-5b09-4a5a-ba7a-4d5c2cfb07e0",
  "message": "Switch this sign-in screen to dark mode, then add a matching forgot-password screen.",
  "elementIds": ["3f9e6eb6-5525-4383-9375-67e0bd762dbe"]
}
```

**Output** — `{ status, fileId, screenIds, reply? }`.

```json
{
  "status": "generated",
  "fileId": "5c2170f0-5b09-4a5a-ba7a-4d5c2cfb07e0",
  "screenIds": [
    "3f9e6eb6-5525-4383-9375-67e0bd762dbe",
    "c13d3707-0efe-49f5-b6cb-0ca5ac5223d0"
  ]
}
```

* `status` — `"generated"` when screens were built or changed. `"chat"` when Flowstep replied without building, in which case `reply` holds its answer and `screenIds` is empty. If your brief is ambiguous, your agent should ask you to clarify and call the tool again.
* `screenIds` — every screen built or changed during the call, including screens edited in place. If the call times out after some screens are built, it returns those screens instead of an error.

> [!WARNING]
>
> Screens you ask it to edit are overwritten in place.

***

### `ai-generate-screen-variant`

Add a new screen derived from exactly one existing screen — the next step in the flow, an error or empty state, or a version for another platform. The original screen is left unchanged. To add a screen that isn’t a variant of an existing one (for example, a settings screen), use `ai-design-screens` with a `fileId`.

**Input**

| Parameter | Type | Description |
| - | - | - |
| `fileId` | `uuid` | Target file |
| `screenId` | `uuid` | The existing screen to derive from |
| `operationVariant` | enum | **Required** — how the new screen relates to the existing one |

| `operationVariant` | Adds |
| - | - |
| `next_screen` | The next screen in the user flow |
| `error_state` | An error state of the screen |
| `empty_state` | An empty state of the screen |
| `web_version` | A web version |
| `mobile_version` | A mobile version |
| `tablet_version` | A tablet version |
| `mobile_ios_version` | An iOS version |
| `mobile_android_version` | An Android version |

**Output** — `{ status, fileId, screenIds }`. `status` is always `"generated"`.

***

### `ai-edit-screen-variant`

Change exactly one existing screen in place using a preset — theme or polish it, try a different layout or visual style, or redesign it from scratch. For new screens, free-form instructions, or a precise edit to individual elements, use `ai-design-screens`.

**Input**

| Parameter | Type | Description |
| - | - | - |
| `fileId` | `uuid` | Target file |
| `screenId` | `uuid` | The existing screen to change |
| `operationVariant` | enum | **Required** — the edit or redesign preset to apply |

| `operationVariant` | Type | Effect |
| - | - | - |
| `dark_theme` | Edit | Switch the screen to a dark theme |
| `light_theme` | Edit | Switch the screen to a light theme |
| `make_pretty` | Edit | Polish the screen’s visual design |
| `different_layout` | Redesign | Try a different layout |
| `different_style` | Redesign | Try a different visual style |
| `from_scratch` | Redesign | Redesign the screen from scratch |

**Output** — `{ status, fileId, screenIds }`. `status` is always `"generated"`.

> [!WARNING]
>
> This overwrites the screen’s content in place.

***

## Renamed tools

Tool names changed in September and October 2026. If you have prompts, scripts, or agent instructions that use the old names, update them:

| Old name | New name |
| - | - |
| `get-screen` | `get-screen-jsx` |
| `add-screen` | `add-screen-jsx` |
| `replace-screen` | `replace-screen-jsx` |
| `ai-generate-screens` | `ai-design-screens` |
| `ai-edit-screens` | `ai-design-screens` |
| `create-new-design` | `ai-design-screens` |
| `edit-design` (free-form instructions) | `ai-design-screens` |
| `edit-design` (with an `operationVariant` preset) | `ai-edit-screen-variant` |
| `regenerate-design` | `ai-edit-screen-variant` |
| `expand-design` | `ai-generate-screen-variant` |
| `get-design-guidelines` | `get-file-instructions` |
| `update-design-guidelines` | `update-file-instructions` |
| `delete-design-guidelines` | `delete-file-instructions` |

Inputs changed too: the AI design tools take `elementIds` (or a single `screenId` for the variant tools) instead of `targets`, `add-screen-jsx` takes `jsx` and explicit metadata fields instead of `jsxContent` with a metadata comment, `create-file` takes `name` instead of `title`, and the file instructions tools take `fileId` instead of `resourceId` and `linkedTo`, with `update-file-instructions` taking `instructions` in place of `designGuidelines`.
