Devmachinist /Docs
Sign in Start
All docs

MCP tool reference

The MCP server exposes 101 tools, including every tool the builder's AI chat uses (see the in-app AI chat's tools at the end). Each one calls a single route of the Platform API with the caller's token, so the route's checks, limits and errors apply. A tool appears in tools/list only when the token holds its scope.

How to read this page:

  • Scope is the scope the tool needs. A few routes ask for more, noted with the tool.
  • Route is the REST call the tool makes; {projectId} and the other braces are filled from the arguments.
  • Arguments come from the tool's input schema. Every project tool takes projectId, a project id from list_projects such as Vq3xT8mKp2Lw. The server checks only that required arguments are present; the route validates the rest.
  • Returns shows the route's JSON reply, shortened. In MCP the whole reply is structuredContent. content[0].text is the reply's text (or the chat tool's result, or the error) followed by the other fields when they are small, so you read a summary rather than the same data as escaped JSON. A reply without a summary arrives as pretty-printed JSON. inspect_page adds the screenshot as an image content block. isError is true when the reply has "ok": false or an HTTP error status.

Ids you will meet: projects (Vq3xT8mKp2Lw), staged imports (stg_4f1c9a0b7e2d6c35), collected sources (src_9a1e0c44b7d2), connections (conn_3c9f1a0e7b25d4), staged database changes (dbs_…) and migrations (mig_…).

Projects and orientation #

Start here: what exists, and a cheap overview before reading code.

whats_new #

What changed in these tools, by version: tools added (+), changed (~) and removed (-). The current version is in initialize (serverInfo.version, e.g. 1.3.0+1cc4bf78d8ae: the version, then a fingerprint of the tool list) and at the start of the server's instructions. Keep the version you last worked with and pass it as since to see only what changed after it.

Scope: read. Route: GET /api/agent/changelog?since={since} (also without a token).

ArgumentTypeRequiredMeaning
sincestringnoA version, e.g. 1.2.0. Without it you get the whole changelog.
json
{ "since": "1.2.0" }
text
Tools version 1.3.0 (99 tools, fingerprint 1cc4bf78d8ae).
Changes since 1.2.0:

1.3.0 (2026-11-14): Know what changed: a version, a fingerprint and this changelog. Generated files are protected by the tools, and checks report more.
  + whats_new — What changed in the tools, by version (also GET /api/agent/changelog).
  ~ build_check — When the build fails it also lists the other syntax errors and broken imports …

list_projects #

Lists the projects the token can reach: your own and those your teams share with you. A token limited to certain projects sees only those.

Scope: read. Route: GET /api/projects.

No arguments.

json
{}
json
{ "ok": true, "projects": [ { "id": "Vq3xT8mKp2Lw", "name": "Corner Bakery", "updatedAt": "2026-11-12T16:40:03.112Z", "componentCount": 4, "pageCount": 2, "running": false, "template": null, "isTemplate": false } ] }

Team projects carry shared: {team, teamSlug} and owner.

get_project #

The project manifest: pages, components (without code), packages, brand, settings, and whether its preview runs.

Scope: read. Route: GET /api/projects/{projectId}.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
json
{ "projectId": "Vq3xT8mKp2Lw" }
json
{ "ok": true, "project": { "id": "Vq3xT8mKp2Lw", "name": "Corner Bakery", "pages": [ { "name": "Home", "slug": "home", "components": ["Hero"] } ], "components": [ { "name": "Hero", "category": "component" } ], "running": false, "url": null, "ready": false } }

project_map #

A compact map of the project in about 500 characters: pages with who may open them, components, modules, data models with row counts, sign-in and roles, theme, design direction, which files are generated, connections, a running experiment and out-of-date sources. Its version changes whenever any of that changes, so an agent can tell whether its picture is still current. With topic, it also returns that part of the full context.

Scope: read. Route: GET /api/projects/{projectId}/ai/map?topic=&names=.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
topicstringnocomponents, design, data, auth, structure, modules, files, connections, graphics or tools.
namesstringnoComma-separated component names, with topic: "components".
json
{ "projectId": "Vq3xT8mKp2Lw", "topic": "components", "names": "Hero,MenuList" }
json
{ "ok": true, "map": "Project map (version 3fa91c0e) — \"Corner Bakery\"\nPages: Home (#home), Menu (#menu)\nComponents (4): SiteNav, SiteFooter, Hero, MenuList\n…", "context": "COMPONENTS …\n- Hero: import Hero from '../components/Hero.jsx' …" }

topic: "tools" returns the size, quota and guarantee notes also found in GET /api/agent; graphics returns the 3D/WebGL guide.

project_symbols #

An index for writing code that fits: every exported component in src/ with its tag, export form and props; hooks and utilities; library components; installed packages.

Scope: read. Route: GET /api/projects/{projectId}/symbols.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
json
{ "projectId": "Vq3xT8mKp2Lw" }
json
{ "ok": true, "symbols": [ { "file": "src/components/Hero.jsx", "name": "Hero", "tag": "Hero", "exportType": "default", "primary": true, "props": [], "kind": "function" } ], "library": [ { "name": "PricingTable", "folder": "marketing", "library": "shared", "props": ["plans"] } ], "packages": ["react", "react-dom"] }

Starting a project #

Create projects from templates or your own projects, and have Devmachinist's AI build a whole site from a description. A token limited to some projects can't create projects.

list_templates #

The starting points for create_project.

Scope: read. Route: GET /api/templates.

json
{ "ok": true, "templates": { "blank": { "label": "Blank", "description": "One empty page. Add sign-in if you want it.", "authOption": true }, "ecommerce": { "label": "Online store", "…": "…" }, "blog": { "…": "…" }, "library": { "…": "…" } } }

create_project #

Creates a project. It can start from a template: blank (auth: true adds sign-in), ecommerce (a store with products, variants, cart, checkout, orders, sign-in and an admin portal), blog (posts, members and an admin portal), library (a component library) or game (a multiplayer game on its own game server; auth: true adds sign-in — see Multiplayer games). Or it can be a full copy of one of your own projects (from): pages, components, brand, design, and its data APIs with their public rows. It never copies users, keys or orders. Plan limits apply (402 when the plan has no room for another project).

Scope: write. Route: POST /api/projects.

ArgumentTypeRequiredMeaning
namestringyesUp to 80 characters.
templatestringnoblank (default), ecommerce, blog, library or game.
authbooleannoSign-in for a blank project.
fromstringnoId of your own project to copy (instead of a template).
json
{ "name": "Corner Bakery", "template": "ecommerce" }
json
{ "ok": true, "project": { "id": "Vq3xT8mKp2Lw", "name": "Corner Bakery", "siteSlug": "corner-bakery", "template": "ecommerce", "pages": [ { "name": "Home" }, { "name": "Shop" }, "…" ] }, "admin": { "email": "dana@example.com", "password": "…" } }

admin is the store's or blog's first admin account for the site itself (shown once; it is the creator's email with a generated password).

build_with_ai #

Has Devmachinist's own AI build the whole site from a description, on the account's AI choice and credits. It plans the pages, the design system, the data models and sign-in, writes every section and page, then builds, opens every page and fixes what fails. On a template or a copied project it adapts what is there. It runs on the server: the call answers at once, and you follow it with build_status. The person sees it as a chat in the builder.

Scope: write. Route: POST /api/projects/{projectId}/ai/build (with ask: false, so it starts without asking the person clarifying questions).

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
promptstringyesWhat the site is: the business, audience, pages, features and style (≥ 8 characters, ≤ 4,000).
json
{ "projectId": "Vq3xT8mKp2Lw", "prompt": "A neighbourhood bakery in Leith: menu with prices, opening hours, pre-orders for collection, a short story page. Warm, handwritten feel." }
json
{ "ok": true, "thread": { "id": "thr_…", "title": "Build: A neighbourhood bakery in Leith…" } }

409 when a build is already running for the project, or the account has 3 running. 402 when the plan or AI credits stop it.

build_status #

AI builds running now or finished in the last hour: the project, status (running, done, error, stopped, cancelled), the steps done out of the total, and any problems left after the checks.

Scope: read. Route: GET /api/ai/jobs.

json
{ "ok": true, "jobs": [ { "projectId": "Vq3xT8mKp2Lw", "projectName": "Corner Bakery", "kind": "build", "status": "running", "done": 7, "total": 14, "startedAt": "2026-11-14T10:02:11.000Z" } ] }

Launcher widgets #

Widgets for the Devmachinist launcher on Android. Each shows a page of the published site, live, in a box on the phone's home screen.

list_widgets #

The project's widgets with their page, size in home-screen cells and address (null until the site is published).

Scope: read. Route: GET /api/projects/{projectId}/widgets.

json
{ "ok": true, "published": true, "widgets": [ { "id": "7420468622", "name": "Today's specials", "page": "TodaysSpecialsWidget", "slug": "widget-todaysspecials", "w": 4, "h": 2, "refresh": 900, "url": "https://sites.devmachinist.com/@dana/corner-bakery/widget-todaysspecials/", "missingPage": false } ] }

add_widget #

Adds a widget. Without page, a hidden page named after the widget is created with a small starter design; edit it like any page and keep it compact, since it fills the box. It shows on phones once the site is published. A project can have up to 12 widgets.

Scope: write. Route: POST /api/projects/{projectId}/widgets.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
namestringyesUp to 40 characters.
wintegernoWidth in cells, 1–5 (default 2).
hintegernoHeight in cells, 1–4 (default 2).
pagestringnoAn existing page to show instead of a new one.
refreshintegernoSeconds between reloads, 60–86400 (default 900).
json
{ "projectId": "Vq3xT8mKp2Lw", "name": "Today's specials", "w": 4, "h": 2 }
json
{ "ok": true, "widget": { "id": "7420468622", "name": "Today's specials", "page": "TodaysSpecialsWidget", "w": 4, "h": 2, "url": null }, "text": "Added the “Today's specials” widget (4×2) showing the TodaysSpecialsWidget page. Publish the site so the launcher can show it." }

Change or remove one with PUT / DELETE /api/projects/{projectId}/widgets/{id} (name, w, h, page, refresh). Removing a widget keeps its page.

Instructions #

People write instructions for the AI per project and for their own account (More → AI in the builder). The in-app chat follows them, and project_map ends with them, so an agent sees them before it starts.

get_knowledge #

The project's instructions (written by the people on it) and your account's (for every project you work on).

Scope: read. Route: GET /api/projects/{projectId}/knowledge.

json
{ "ok": true, "project": "Prices are in euros. Keep the hero photo.", "account": "Always check the phone layout.", "max": 20000, "text": "PROJECT INSTRUCTIONS …" }

set_knowledge #

Replaces the project instructions, your account instructions, or both. Each is plain text or Markdown of up to 20,000 characters, and an empty string clears it. Write lasting rules, not a log of what you did.

Scope: write. Route: PUT /api/projects/{projectId}/knowledge.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
projectstringnoInstructions for everyone on this project.
accountstringnoYour own, for every project.
json
{ "projectId": "Vq3xT8mKp2Lw", "project": "Prices are in euros. Keep the hero photo. Never change the Order model." }

Reading files #

list_files #

The workspace's file tree. Each project is a real Vite + React + Tailwind CSS v4 app; node_modules, .git, dist and .cache are left out.

Scope: read. Route: GET /api/projects/{projectId}/files.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
json
{ "projectId": "Vq3xT8mKp2Lw" }
json
{ "ok": true, "scaffolded": true, "tree": [ { "type": "dir", "name": "src", "path": "src", "children": [ { "type": "file", "name": "App.jsx", "path": "src/App.jsx", "size": 1204, "ext": ".jsx" } ] } ] }

Before the workspace exists (scaffolded: false) the tree is empty; start_preview creates it.

read_file #

A whole text file, up to 5 MB. For anything long, read_lines is cheaper. A folder path returns its children instead.

Scope: read. Route: GET /api/projects/{projectId}/files/{path}.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
pathstringyesRelative path, e.g. src/pages/Home.jsx.
json
{ "projectId": "Vq3xT8mKp2Lw", "path": "src/index.css" }
json
{ "ok": true, "type": "file", "path": "src/index.css", "size": 911, "content": "@import \"tailwindcss\";\n/* pb:brand */\n…" }

read_lines #

Numbered lines of a file. At most 2,000 lines and about 100,000 characters per call, always whole lines; when it stops early the text ends with where to continue. Files up to 512 KB.

Scope: read. Route: GET /api/projects/{projectId}/lines/{path}?from=&to=.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
pathstringyesThe file.
fromintegernoFirst line, 1-based (default 1).
tointegernoLast line, inclusive (default: 2,000 lines on).
json
{ "projectId": "Vq3xT8mKp2Lw", "path": "src/components/MenuList.jsx", "from": 40, "to": 80 }
json
{ "ok": true, "path": "src/components/MenuList.jsx", "from": 40, "to": 80, "total": 112, "text": "40│  const items = useMemo(() => …\n41│ …" }

The │ after each number isn't part of the file; leave it out when you copy text into an edit.

search_project #

Searches the text files under src/ and index.html (each up to 512 KB) for text or a regular expression. Patterns run with a 4-second limit; at most 2,000 matches.

Scope: read (although it's a POST). Route: POST /api/projects/{projectId}/search.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
qstringyesWhat to find.
regexbooleannoTreat q as a JavaScript regular expression.
json
{ "projectId": "Vq3xT8mKp2Lw", "q": "bg-amber-\\d+", "regex": true }
json
{ "ok": true, "total": 3, "truncated": false, "files": [ { "path": "src/components/Hero.jsx", "managed": false, "matches": [ { "line": 10, "col": 52, "pre": "…inline-block rounded-full ", "text": "bg-amber-600", "post": " px-6 py-3" } ] } ] }

managed: true marks generated files, which you shouldn't edit.

Editing files #

The line tools (edit_file, replace_text, replace_lines, insert_lines) change existing files only: index.html and text files under src/ ending in .jsx .tsx .js .ts .css .json .glsl .vert .frag, up to 512 KB. They refuse the generated files src/site.js, src/App.jsx, src/main.jsx and src/api/, which the builder rewrites from the project. Each reply lists problems: syntax errors the change caused in that file. Live previews hot-reload, and teammates' open editors follow the change.

edit_file #

All the changes one file needs in one call: a list of exact snippets and their replacements, applied in order, all or nothing. Each old_text must appear exactly once in the file as it is at that step. This is the recommended way to change code.

Scope: write. Route: POST /api/projects/{projectId}/edit with op: "edits".

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
pathstringyesThe file.
editsarrayyesUp to 40 objects {old_text, new_text}, both strings.
json
{
  "projectId": "Vq3xT8mKp2Lw",
  "path": "src/components/SiteFooter.jsx",
  "edits": [
    { "old_text": "<p>© Corner Bakery</p>", "new_text": "<p>© Corner Bakery · Open daily 7:00–15:00</p>" },
    { "old_text": "text-stone-500", "new_text": "text-stone-300" }
  ]
}
json
{ "ok": true, "message": "Made 2 changes to src/components/SiteFooter.jsx", "problems": [] }

On a miss nothing is written: Edit 2 of 2: old_text appears more than once — include more surrounding text so it is unique (nothing was changed).

replace_text #

Replaces one exact, unique snippet. The cheapest call for a single small change.

Scope: write. Route: POST /api/projects/{projectId}/edit with op: "replace_text".

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
pathstringyesThe file.
old_textstringyesThe exact text to replace; must appear once.
new_textstringyesIts replacement (may be empty).
json
{ "projectId": "Vq3xT8mKp2Lw", "path": "src/pages/Menu.jsx", "old_text": "Our menu", "new_text": "Today's bakes" }
json
{ "ok": true, "message": "Edited src/pages/Menu.jsx", "problems": [] }

replace_lines #

Replaces lines from to to (1-based, inclusive) with new text. Read the lines first so the numbers are current; a to past the end stops at the last line.

Scope: write. Route: POST /api/projects/{projectId}/edit with op: "replace_lines".

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
pathstringyesThe file.
fromintegeryesFirst line to replace.
tointegeryesLast line to replace.
textstringyesThe new lines (may contain line breaks, or be empty to delete).
json
{ "projectId": "Vq3xT8mKp2Lw", "path": "src/components/Hero.jsx", "from": 9, "to": 9, "text": "      <p className=\"mt-4 text-lg\">Sourdough, pastries and coffee.</p>" }
json
{ "ok": true, "message": "Replaced lines 9–9 of src/components/Hero.jsx", "problems": [] }

insert_lines #

Inserts text after a line (0 inserts at the top).

Scope: write. Route: POST /api/projects/{projectId}/edit with op: "insert".

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
pathstringyesThe file.
afterintegeryesThe line to insert after; 0 for the top.
textstringyesThe lines to insert.
json
{ "projectId": "Vq3xT8mKp2Lw", "path": "src/components/Hero.jsx", "after": 0, "text": "import { Clock } from 'lucide-react'" }
json
{ "ok": true, "message": "Inserted after line 0 of src/components/Hero.jsx", "problems": [] }

write_file #

Creates or overwrites a whole text file anywhere in the workspace (up to 5 MB), creating folders as needed. Writing a component's or page's file keeps the project's copy in step. Use it for new files outside src/components/ and src/pages/, and for config or content files; prefer edit_file for existing code. .git/, node_modules/ and .npmrc can't be written (403). The generated files src/site.js, src/App.jsx, src/main.jsx and src/api/ are refused too (403): the answer names the tool that changes what they hold (pages and routing, theme, data API).

Scope: write. Route: PUT /api/projects/{projectId}/files/{path}.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
pathstringyesThe file to write.
contentstringyesThe whole new content.
json
{ "projectId": "Vq3xT8mKp2Lw", "path": "src/lib/hours.js", "content": "export const HOURS = { open: '7:00', close: '15:00' }\n" }
json
{ "ok": true, "path": "src/lib/hours.js" }

delete_file #

Deletes a file, or a folder with everything in it. Generated files are refused (403), as with write_file. It removes only what's on disk: a component or page deleted this way stays in the project's list. To remove a component completely, use the REST route DELETE /api/projects/{projectId}/components/{Name}.

Scope: write. Route: DELETE /api/projects/{projectId}/files/{path}.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
pathstringyesThe file or folder.
json
{ "projectId": "Vq3xT8mKp2Lw", "path": "src/lib/old-prices.js" }
json
{ "ok": true }

import_url #

Saves a file from the web into the project without the model reading or retyping it: a stylesheet, script, JSON, SVG, image, text file or 3D model whole, or with selectors only the matching CSS rules (including inside @media and @supports, with the :root variables and @keyframes they use). It follows robots.txt, fetches at most 20 times a minute per site and 2 MB per file (images 5 MB, 3D files 25 MB), and refuses private addresses and HTML pages.

Scope: write. Route: POST /api/projects/{projectId}/import-url.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
urlstringyesThe file's address, or a page's when using selectors.
selectorsarray of stringsnoCSS selectors to extract (up to 40; .btn* matches a class prefix).
pathstringnoWhere to save it, under src/styles, src/vendor, src/data, src/lib, src/assets or public/. The extension must fit the kind.
overwritebooleannoReplace an existing file. Images and 3D files are never overwritten.

Default destinations: CSS to src/styles/<name>.css (also @imported into src/index.css), JavaScript to public/vendor/, JSON to src/data/, images and SVG to public/media/, 3D files to public/models/.

json
{ "projectId": "Vq3xT8mKp2Lw", "url": "https://cornerbakery.example/styles/site.css", "selectors": [".btn*", ".card"] }
json
{ "ok": true, "path": "src/styles/cornerbakery-example.css", "kind": "css", "from": "https://cornerbakery.example/styles/site.css", "message": "Saved https://cornerbakery.example/styles/site.css as src/styles/site.css (3.1 KB) and imported it in src/index.css." }

An existing file answers 409 unless overwrite is set.

upload_url #

A one-time address to upload a file into the project, so its contents never pass through the model: PUT the bytes to it within 15 minutes, once, for example curl -T ./logo.png "<url>". Use it for images, fonts, PDFs, CSV and JSON data, or any file longer than a few lines. The file lands at path. A file already there is refused unless overwrite is set, and a generated file always is (403). The limit is 25 MB per file. The address is the credential, so treat it like a token. It works from anywhere, and the PUT needs no other header.

Scope: write. Route: POST /api/projects/{projectId}/upload-url, then PUT /api/uploads/{token}.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
pathstringyesWhere the file goes, e.g. public/media/logo.png or src/data/menu.json.
overwritebooleannoReplace a file that is there.
json
{ "projectId": "Vq3xT8mKp2Lw", "path": "public/media/logo.png" }
json
{ "ok": true, "url": "https://devmachinist.com/api/uploads/gT-f6YT3iKYSwBYeQRajQuubdE6C1m4o", "method": "PUT", "path": "public/media/logo.png", "expiresAt": "2026-11-14T10:17:00.000Z", "maxBytes": 26214400, "text": "PUT the file's bytes to this address within 15 minutes, once: curl -T <local file> \"…\" …" }
bash
curl -T ./logo.png "https://devmachinist.com/api/uploads/gT-f6YT3iKYSwBYeQRajQuubdE6C1m4o"
# {"ok":true,"path":"public/media/logo.png","size":48213}

A used or expired address answers 404; a file that another AI is changing answers 423. Clients without a shell (claude.ai) can't PUT, so they should use import_url for files on the web.

Components and pages #

Components live in src/components/<Name>.jsx and pages in src/pages/<Name>.jsx, default-exported and styled with Tailwind classes. The project keeps a list of both; these tools keep the list and the files together.

get_component #

A component's source as the project holds it.

Scope: read. Route: GET /api/projects/{projectId}/components/{name}/code.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
namestringyesThe component's name, e.g. Hero.
json
{ "projectId": "Vq3xT8mKp2Lw", "name": "Hero" }
json
{ "ok": true, "name": "Hero", "code": "export default function Hero() {\n  return (…)\n}\n" }

create_component #

Adds a component: registers it with the project and writes src/components/<Name>.jsx. Names use letters, digits, _ and - (PascalCase by convention); code up to 1 MB. 409 if it exists.

Scope: write. Route: POST /api/projects/{projectId}/components.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
namestringyesThe new component's name.
codestringyesIts full source.
json
{ "projectId": "Vq3xT8mKp2Lw", "name": "OpeningHours", "code": "export default function OpeningHours() {\n  return <p className=\"text-sm text-stone-300\">Open daily 7:00–15:00</p>\n}\n" }
json
{ "ok": true, "component": { "name": "OpeningHours", "category": "component", "imports": [], "exports": ["default"], "missingPackages": [] } }

missingPackages lists imported packages that aren't installed yet.

update_component #

Replaces a component's whole source.

Scope: write. Route: PUT /api/projects/{projectId}/components/{name}.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
namestringyesThe component.
codestringyesIts new full source.
json
{ "projectId": "Vq3xT8mKp2Lw", "name": "OpeningHours", "code": "export default function OpeningHours({ open = '7:00', close = '15:00' }) { … }" }
json
{ "ok": true, "component": { "name": "OpeningHours", "missingPackages": [] } }

get_page #

A page's source, read from its file (or generated from its components if the file doesn't exist yet).

Scope: read. Route: GET /api/projects/{projectId}/pages/{name}/code.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
namestringyesThe page's name, e.g. Home.
json
{ "projectId": "Vq3xT8mKp2Lw", "name": "Home" }
json
{ "ok": true, "name": "Home", "code": "import Hero from '../components/Hero.jsx'\n…" }

create_page #

Adds a page to the project and its navigation. The name must be a JavaScript identifier such as AboutUs; the slug (a–z, 0–9, dashes) defaults to the lowercased name, e.g. aboutus. If the workspace exists, a starter page file is written and the router updated. Links to it are href="#slug".

Scope: write. Route: POST /api/projects/{projectId}/pages.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
namestringyesThe page's name.
slugstringnoIts address.
json
{ "projectId": "Vq3xT8mKp2Lw", "name": "Visit", "slug": "visit" }
json
{ "ok": true, "page": { "name": "Visit", "slug": "visit", "components": [], "hasCustomCode": false } }

delete_page #

Deletes a page for good: its file (src/pages/<Name>.jsx), its route and its menu entry. It leaves the published site at the next publish. Deleting the page's file with delete_file does the same. To keep a page reachable but out of the menu, use set_page_access with listed: false instead. A site keeps at least one page.

Scope: write. Route: DELETE /api/projects/{projectId}/pages/{page}.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
pagestringyesPage name or slug.
json
{ "projectId": "Vq3xT8mKp2Lw", "page": "Scratch" }
json
{ "ok": true, "deleted": "Scratch", "pages": ["Home", "Menu", "Visit"], "text": "Deleted the Scratch page and src/pages/Scratch.jsx. Pages now: Home, Menu, Visit. Publish again to take it off the live site." }

404 for an unknown page, 400 for the last page. In the in-app chat, delete_page can be undone.

update_page #

Replaces a page's whole source (written to its file) and refreshes the router.

Scope: write. Route: PUT /api/projects/{projectId}/pages/{name}.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
namestringyesThe page.
codestringyesIts new full source.
json
{ "projectId": "Vq3xT8mKp2Lw", "name": "Visit", "code": "import OpeningHours from '../components/OpeningHours.jsx'\n\nexport default function Visit() { … }\n" }
json
{ "ok": true, "page": { "name": "Visit", "slug": "visit" } }

The REST route also takes slug, newName, listed, roles and description; see the Platform API.

generate_component #

Asks the AI that applies to you in this project (your choice, else the site's default) to write one component that fits the project's components, packages, data and design. It returns code and saves nothing: add it with create_component. It uses your AI allowance and, on the site's keys, AI credits (402 when there are none).

Scope: write. Route: POST /api/ai/component.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project the component is for.
promptstringyesWhat to build, up to 8,000 characters.
namestringnoThe component's name (letters, digits, _; starts with a letter).
json
{ "projectId": "Vq3xT8mKp2Lw", "prompt": "A testimonial carousel with three quotes from regulars, swipeable on phones", "name": "Testimonials" }
json
{ "ok": true, "name": "Testimonials", "code": "import { useState } from 'react'\n…", "props": [], "warnings": [], "provider": "anthropic", "model": "claude-opus-5-5", "tokens": 4120, "credits": { "spent": 0.0412, "left": 9.21, "unlimited": false } }

Theme #

get_theme #

The site's brand and theme: name and tagline; brand, secondary and accent colour families and extra named palettes; heading and standard fonts; text styles per element; light/dark mode; radius, density, shadows and text size; plus the allowed fonts, colour families and options.

Scope: read. Route: GET /api/projects/{projectId}/brand.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
json
{ "projectId": "Vq3xT8mKp2Lw" }
json
{ "ok": true, "brand": { "name": "Corner Bakery", "tagline": "Baked before sunrise", "primary": "amber", "secondary": "stone", "accent": "rose" }, "theme": { "mode": "system", "headingFont": "fraunces", "bodyFont": "inter", "radius": "lg", "density": "cozy" }, "colors": ["slate", "gray", "…"], "fonts": { "…": "…" } }

set_theme #

Changes the brand and theme. It validates everything first (400 on an unknown colour, font or option) and then rewrites src/site.js, index.html and the managed block of src/index.css, so the preview updates.

Scope: write. Route: PUT /api/projects/{projectId}/brand.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
namestringnoSite name (60 characters).
taglinestringnoTagline (160 characters).
primarystringnoBrand colour: a Tailwind colour family such as amber.
secondarystringnoSurfaces, structure and text.
accentstringnoSmall highlights.
themeobjectnoAny of headingFont, bodyFont (or standardFont), mode (system, light, dark), text (per element h1 h2 h3 h4 p span a li button label blockquote code: {font, weight, size, tracking, leading, case, style} or null), radius (none, sm, md, lg, xl), density (compact, cozy, roomy), shadow (none, soft, bold), size (small, normal, large), addColors [{name, family}], removeColors [name], colors (replace the list).
json
{ "projectId": "Vq3xT8mKp2Lw", "primary": "orange", "theme": { "headingFont": "Playfair Display", "radius": "xl", "text": { "h1": { "weight": "bold", "size": "5xl", "tracking": "tight" } } } }
json
{ "ok": true, "brand": { "primary": "orange", "…": "…" }, "theme": { "headingFont": "playfair", "radius": "xl", "…": "…" } }

Preview and checks #

start_preview #

Starts the project's sandboxed live preview (Vite), installing packages on the first run, which can take a minute. If it's already running the reply has already: true. Needs an active plan or trial (402); 30 starts per 10 minutes.

Scope: preview. Route: POST /api/projects/{projectId}/start.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
json
{ "projectId": "Vq3xT8mKp2Lw" }
json
{ "ok": true, "running": true, "url": "https://preview.devmachinist.com/_preview/Vq3xT8mKp2Lw/", "ready": true }

The preview address is meant for the builder's frames; agents look at pages with inspect_page. There is no stop tool: the REST route POST /api/projects/{projectId}/stop (preview scope) stops it.

preview_status #

Whether the preview runs, is starting, and is ready.

Scope: read. Route: GET /api/projects/{projectId}/status.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
json
{ "projectId": "Vq3xT8mKp2Lw" }
json
{ "ok": true, "running": true, "ready": true, "starting": false, "url": "https://preview.devmachinist.com/_preview/Vq3xT8mKp2Lw/" }

preview_logs #

The last 100 lines of the preview's output: Vite's compile errors and warnings after an edit.

Scope: read. Route: GET /api/projects/{projectId}/logs.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
json
{ "projectId": "Vq3xT8mKp2Lw" }
json
{ "ok": true, "logs": ["VITE ready in 812 ms", "hmr update /src/components/Hero.jsx"] }

An empty list means the preview isn't running.

build_check #

Builds the site both ways it runs: the preview (Vite, development mode, seconds) and the published site (Next.js static export, usually under a minute). Code must work in both; Vite-only import suffixes such as ?raw fail the second build. A failed build is an isError result with the file, line, column and the lines around it. A build stops at its first error, so a failed check also lists, under Also found, the other syntax errors and imports of missing files it finds across src/ (up to 25, also as others): fix them in one pass.

Scope: preview. Route: POST /api/projects/{projectId}/check/build.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
json
{ "projectId": "Vq3xT8mKp2Lw" }
json
{ "ok": false, "file": "src/pages/Visit.jsx", "text": "Build failed in src/pages/Visit.jsx:12:5:\nUnexpected token, expected \",\"\n  10 |       <OpeningHours />\n  11 |       <p>Find us on Leith Walk</p>\n> 12 |     </section\n  13 |   )\n  14 | }" }

On success: { "ok": true, "text": "The site builds: the preview (Vite, 3.2 s) and the published site (Next.js, 37.5 s)." }.

inspect_page #

Builds the site and opens one page in a headless browser, optionally clicking, typing and pressing keys first. It reports the page title, each step, page errors, console messages, failed requests, headings, buttons, links, form fields, visible text and any <canvas>. The screenshot comes back as an MCP image content block, so you can look at the page yourself, followed by a resource_link to it (devmachinist://project/{projectId}/screenshot/{shot}) to read it again later.

By default it is a visitor, and writes to the data API are answered with 204 and change nothing. With as (user, admin or a custom role), it first copies every connected API with today's rows and signs in a test account with that role on the copies. Pages behind sign-in then open, admin screens show real data, and forms really submit, to the copies. The copies are deleted afterwards, so real data is never touched.

Scope: preview. Route: POST /api/projects/{projectId}/check/page.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
pagestringnoPage name or slug (default: the first page). With published, an item address such as product/3.
actionsarraynoUp to 25 steps, 5 s each, 90 s per call (below).
viewportstringnodesktop (1280×900, default) or phone (390×844).
selectorstringnoLimit the outline and screenshot to one element.
publishedbooleannoOpen the Next.js export at its real address instead of the preview build.
asstringnoSign in first as a test account with this role (user, admin or a custom role), on throwaway copies of the data.
full_pagebooleannoScreenshot the whole page (up to 4,000 px tall) instead of the first screen.

Steps: {"text": "Order now"} or {"selector": "#cart"} clicks; {"selector": "input[name=email]", "value": "sam@example.com"} fills a field; {"press": "Enter"} (with a selector or text, on that element); {"wait": 800} waits up to 5,000 ms; {"goto": "menu"} moves to another page in the same session.

json
{ "projectId": "Vq3xT8mKp2Lw", "page": "menu", "viewport": "phone", "actions": [ { "text": "Pastries" }, { "wait": 300 } ] }
json
{ "ok": true, "clean": true, "text": "#menu (phone 390×844) — “Corner Bakery”\nSteps:\n  ✓ click “Pastries”\n  ✓ wait 300 ms\nErrors: none\nConsole: empty\nHeadings: Our menu | Pastries\n…\nScreenshot attached.", "screenshot": "/api/projects/Vq3xT8mKp2Lw/ai/shots/shot_mhx5a2b7c4d1e0.png", "image": { "mimeType": "image/png", "data": "iVBORw0KGgo…" } }

Checking the admin screens of a store:

json
{ "projectId": "Vq3xT8mKp2Lw", "page": "admin", "as": "admin" }

The text then ends with Signed in as a test admin (journey-admin@journey.test) on throwaway copies of the data made just now…. An unknown role answers with the roles there are, and a site without sign-in says so.

clean is false when the page had errors. In MCP the picture is the image block (the REST reply has it as image when called with a token). The screenshot URL can also be fetched with the token (read scope), and the newest 30 per project are kept. If the server has no headless browser, the text says so and build_check still works.

simulate_journeys #

Tests the site as a visitor, a signed-in user, an admin and each custom role, on throwaway copies of its data: page errors and accessibility checks (alt text, unnamed buttons and links, unlabelled fields, headings, duplicate ids) per role and page, up to three forms filled and submitted, and a list/add/change/delete probe per model compared with its access rules. The copies and the build are deleted afterwards. The result is an isError when a high-level problem is found, such as visitors being able to change or delete rows.

Scope: preview. Route: POST /api/projects/{projectId}/journeys.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
rolesarray of stringsnoOnly these roles.
json
{ "projectId": "Vq3xT8mKp2Lw", "roles": ["visitor", "admin"] }
json
{ "ok": true, "summary": "2 roles, 3 pages, 1 form, 2 models", "roles": ["visitor", "admin"], "problems": [], "permissions": { "…": "…" }, "text": "…\nPermissions:\n  Order  visitor: list ✗ add ✓ change ✗ delete ✗ …" }

game_test #

Tests the project's multiplayer game server (rooms in server/) with real players. Each test player is a real Colyseus client, using the project's own @colyseus/sdk. Your rooms see the 2–8 players as signed in, with test identities (test-1, player1@test.invalid …, role user or the one you give), or as guests. The players run your steps in order against the dev server (the code in server/) or the live one (the published copy). The run stops at the first step that fails. You get every step's result, what each player received, each room's state at the end and the server's output during the run. Nothing touches the data API. A run takes at most 55 seconds and 200 steps, and six runs fit in one Chat answer.

Scope: preview. Route: POST /api/projects/{projectId}/game/test.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
stepsarrayyesThe steps (below).
playersarrayno[{name, guest, role}], default two signed-in players.
modestringnodev (default) or live.
limit_msintegernoTime limit, up to 55,000.

The steps:

  • {player, join: "room", method, id, options, as} joins a room. method is joinOrCreate (the default), create, join, or joinById with id. as names the room in later steps.
  • {player, send: "type", message, room} sends a message.
  • {player, expect: "type", room, match, save, timeout} waits for a message (5 s by default). match is {field: value}, and save keeps the message under a name.
  • {player, absent: "type", room, for} checks that a message does NOT arrive within for ms.
  • {player, state: "room", check: {path, equals or min or max or exists, size}} checks the room's synced state.
  • {player, leave: "room"} leaves the room; {wait: ms} pauses.

In options, message, id and match, a string like "$go.roomId" is replaced by the saved value.

json
{ "projectId": "Vq3xT8mKp2Lw", "players": [{ "name": "Ann" }, { "name": "Bob" }], "steps": [
  { "player": 0, "join": "lobby", "save": "a" },
  { "player": 1, "join": "lobby", "save": "b" },
  { "player": 0, "send": "invite", "message": { "to": "$b.sessionId" } },
  { "player": 1, "expect": "invite", "save": "inv" },
  { "player": 1, "send": "answer", "message": { "id": "$inv.id", "yes": true } },
  { "player": 0, "expect": "go", "save": "go" },
  { "player": 0, "join": "arena", "id": "$go.roomId", "as": "arena" },
  { "player": 0, "state": "arena", "check": { "path": "players", "size": true, "min": 1 } }
] }
json
{ "ok": true, "mode": "dev", "text": "PASSED: multiplayer test on the dev game server (1.2 s)\n✓ 1. Ann joinOrCreate \"lobby\" → room abc, session x1\n…", "report": [{ "n": 1, "ok": true, "text": "…" }], "rooms": [], "output": [] }

Publishing #

publish #

Builds the site (a Next.js static export) and publishes it as a new snapshot at its public address. The last three snapshots are kept for rollback. It can take a minute.

Scope: publish. Route: POST /api/projects/{projectId}/publish.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
slugstringnoThe site's address: a–z, 0–9 and dashes, up to 48 characters. Default: the current one, or one from the project's name.
json
{ "projectId": "Vq3xT8mKp2Lw" }
json
{ "ok": true, "slug": "corner-bakery", "version": "vmhx4r2d9", "primary": true, "url": "https://sites.devmachinist.com/@dana/corner-bakery/", "size": 812377 }

Refusals: 402 (no free site slot on the owner's plan, for a site not yet published), 403 needsVerification (verify your email), 409 (an experiment is running), 400 (choose a username first, or a bad slug), 422 Build failed with the build's log. Run build_check first. The site belongs to the project's owner, whoever publishes.

Analytics #

get_site_analytics #

Visits to the project's published site:

  • page views, visitors, views per visitor and bounce rate, each against the period before
  • a day-by-day series
  • top pages, sources (referring sites and utm_source), devices, browsers and countries
  • crawlers, counted apart

Published sites set no cookies, so visitors are counted per day. The same person on two days counts twice, and a bounce is a visitor-day with one page view.

Scope: read. Route: GET /api/projects/{projectId}/analytics?days=.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
daysintegernoDays back, default 30, at most 365.
json
{ "projectId": "Vq3xT8mKp2Lw", "days": 30 }
text
“Corner Bakery”, last 30 days: 1,240 page views (+18% vs the 30 days before), 512 visitors (per day, +11%), 2.42 views per visitor, bounce rate 41%.
Busiest days: 2026-11-08 96, 2026-11-01 88, …
Pages: / 610, /menu/ 402, /visit/ 154, /product/:id/ 74.
Sources: Direct 590, google.com 402, instagram.com 188.
Devices: Mobile 870, Desktop 361, Tablet 9. …

The structured result has summary (with prev), series, pages, sources, devices, browsers, countries and bots.

Data API #

A project's data lives in an API from the API builder: models, fields, access rules, sign-in. These tools read and change it the way the API designer does. Data API explains the runtime; Using the client explains the generated hooks.

get_project_api #

The connected data APIs: models and fields, access rules (read, add, change), sign-in and roles, and the generated hooks (useProducts(), useProduct(id)).

Scope: read. Route: GET /api/projects/{projectId}/data-api?apiId=.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
apiIdstringnoOne API, when the project has several.
json
{ "projectId": "Vq3xT8mKp2Lw" }
json
{ "ok": true, "text": "API \"Corner Bakery API\" (k2v9…)\nProduct: id, name string required, price float, category enum[bread, pastry, coffee] · read public, add admin, change admin · useProducts() / useProduct(id)\n…" }

change_project_api #

Changes the data API like the API designer saves it, after validating the whole change (400 and nothing applied on any problem). Field ids and designer settings are kept; removed fields keep their data in the database. When the project has no API yet, add_models creates and connects one. The reply ends with an automatic access check.

Scope: write. Route: POST /api/projects/{projectId}/data-api.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
api_idstringnoWhich API, when there are several.
add_modelsarraynoUp to 12 {name, fields}; fields as below, up to 60 each.
add_fieldsarrayno{model, name, type, required, unique, enum_values, ref_model, default}.
change_fieldsarraynoSame shape; changes an existing field.
remove_fieldsarrayno{model, name}.
remove_modelsarraynoModel names.
rulesarrayno{model, read, create, write}: each public, auth, owner, admin, none or a custom role. create (add) falls back to write when unset.
sign_inbooleannoTurn on sign-in (needed by every rule except public and none).
sample_rowsarrayno{model, rows_json}: up to 20 sample rows, only into empty models.

Field types: string, text, integer, float, boolean, datetime, date, json, uuid, email, url, enum, reference. An owner rule adds a user_id field. The REST route also takes roles (custom role names) and uploads (who may upload files: admin, user or a role).

json
{
  "projectId": "Vq3xT8mKp2Lw",
  "add_models": [ { "name": "Order", "fields": [ { "name": "email", "type": "email", "required": true }, { "name": "product", "type": "reference", "ref_model": "Product" }, { "name": "pickup", "type": "datetime" } ] } ],
  "rules": [ { "model": "Order", "read": "admin", "create": "public", "write": "admin" } ],
  "sign_in": true
}
json
{ "ok": true, "text": "Done: added Order; turned on sign-in; Order: read admin, add public, change admin\n\nAccess check (automatic): no problems.\n\nAPI \"Corner Bakery API\" …" }

Both change_project_api and the chat tool change_api answer with what was done, the automatic access check, and the definition of only the models that changed (with a count of the rest), not the whole API. get_project_api / get_api show everything.

inspect_data #

The data as it stands: each model's fields with their rules, who may read, add and change, row counts, recent rows, references between models, where imported rows came from, and access problems.

Scope: read. Route: GET /api/projects/{projectId}/data/inspect?model=.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
modelstringnoOne model only.
json
{ "projectId": "Vq3xT8mKp2Lw", "model": "Product" }
json
{ "ok": true, "text": "Product — 14 rows · read public, add admin, change admin\n  name string required · price float · category enum …\nRecent: #14 Rye loaf 6.80 bread …" }

query_data #

Exactly the rows you need, read-only: filtered, sorted, paged, with chosen fields; or counts per value (groupBy); or duplicate groups (duplicatesOn, compared trimmed and in any case). References show the referenced row's title or name, or MISSING.

Scope: read. Route: GET /api/projects/{projectId}/data/query.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
modelstringyesThe model.
wherearrayno{field, op, value} conditions, all must match. Ops: eq, ne, lt, lte, gt, gte, contains, starts, in, null, notnull, orphan (a reference to a row that doesn't exist).
sortstringnoField to sort by.
orderstringnoasc or desc.
limitintegernoUp to 250.
offsetintegernoFor paging.
fieldsarray of stringsnoOnly these fields.
groupBystringnoCount rows per value of this field.
duplicatesOnarray of stringsnoFind rows sharing these fields.
apiIdstringnoWhich API.
json
{ "projectId": "Vq3xT8mKp2Lw", "model": "Product", "where": [ { "field": "category", "op": "eq", "value": "pastry" }, { "field": "price", "op": "lt", "value": 4 } ], "sort": "price", "fields": ["id", "name", "price"], "limit": 20 }
json
{ "ok": true, "model": "Product", "total": 2, "offset": 0, "rows": [ { "id": 3, "name": "Croissant", "price": 3.2 }, { "id": 7, "name": "Pain au chocolat", "price": 3.6 } ], "text": "Product: 2 rows match (category eq pastry and price lt 4) — showing 1–2\n  id=3 · name=Croissant · price=3.2\n  …" }

Importing data #

Bulk changes go through a review step: stage (a preview, nothing written) → commit (one transaction, every row read back) → undo if needed. In the builder a person presses Approve on the staged card; an agent with write scope may commit itself with commit_staged after checking the preview.

stage_data #

Plans adding or updating up to 5,000 rows of one model and returns a staged id and preview. Each row is classed as new, update, unchanged or problem: unknown fields are ignored, and required fields, enums, numbers ($12.50 becomes 12.5), booleans and references (by id, or by the referenced row's slug, name, title or email) are checked. With match_on, existing rows are matched, so running the same import again updates instead of duplicating. Pending stages expire after a day.

Scope: write. Route: POST /api/projects/{projectId}/data/stage.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
modelstringyesThe model to fill.
rows_jsonstringone sourceA JSON array of objects, as a string.
csvstringone sourceCSV text with a header row.
file_pathstringone sourceA CSV or JSON file in the workspace, up to 10 MB (e.g. a file uploaded to uploads/).
source_urlstringone sourceA JSON or CSV file on the web (not a page), up to 2 MB.
source_idstringone sourceA source from collect_source; each row keeps its page URL as evidence.
mapping_jsonstringnoJSON object: model field → source key (dots reach into nested objects). Without it, keys are used as they are.
defaults_jsonstringnoJSON object of values for fields left empty.
match_onarray of stringsnoFields that identify an existing row.
sourcestringnoA label for where the rows came from.

Give exactly one source. The REST route also takes api_id, and connection_id with resource to import from a linked app.

json
{
  "projectId": "Vq3xT8mKp2Lw",
  "model": "Product",
  "csv": "Item,Price,Type\nSourdough,$8.50,bread\nCroissant,3.20,pastry\nRye loaf,6.80,bread",
  "mapping_json": "{\"name\": \"Item\", \"price\": \"Price\", \"category\": \"Type\"}",
  "match_on": ["name"],
  "source": "Price list November"
}
json
{ "ok": true, "text": "Staged stg_4f1c9a0b7e2d6c35 — Product: 1 new, 1 updated, 1 unchanged. Matched existing rows on name.\nWaiting for the person's approval — …", "staged": { "id": "stg_4f1c9a0b7e2d6c35", "status": "pending", "summary": "Product: 1 new, 1 updated, 1 unchanged", "total": 3, "preview": [ { "i": 1, "action": "update", "values": { "price": 3.2 } } ] } }

commit_staged #

Saves a pending staged change in one transaction: rows with problems are skipped and reported, the rest saved through the normal validation, and every saved row is read back and compared. Records where each row came from and keeps an undo for 30 days. Commit only after you or the person reviewed the preview.

Scope: write. Route: POST /api/projects/{projectId}/data/staged/{stagedId}/commit.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
stagedIdstringyesThe staged id.
json
{ "projectId": "Vq3xT8mKp2Lw", "stagedId": "stg_4f1c9a0b7e2d6c35" }
json
{ "ok": true, "staged": { "id": "stg_4f1c9a0b7e2d6c35", "status": "committed", "results": { "counts": { "created": 1, "updated": 1, "unchanged": 1, "failed": 0, "verified": 2 }, "failed": [], "mismatched": [] } } }

409 when the change isn't pending (already committed, discarded or expired) or its API is no longer connected. During an experiment it commits to the experiment's copy.

discard_staged #

Throws away a staged change that was never saved, so nothing is written. It works for a stage_data preview and for a stage_database_changes change to a connected database (the id tells them apart). import_status lists pending ones.

Scope: write. Route: POST /api/projects/{projectId}/data/staged/{stagedId}/discard.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
stagedIdstringyesThe staged id (stg_… or dbs_…).
json
{ "projectId": "Vq3xT8mKp2Lw", "stagedId": "stg_4f1c9a0b7e2d6c35" }
json
{ "ok": true, "staged": { "id": "stg_4f1c9a0b7e2d6c35", "status": "discarded" }, "text": "Discarded the pending Product change; nothing was written." }

409 when it was already saved (use undo_staged) or already discarded, undone or expired. Pending previews also expire by themselves after a day.

undo_staged #

Undoes a committed staged change: deletes the rows it added and restores the rows it updated. Available for 30 days. Called on a change that was never saved, it discards it instead ("discarded": true).

Scope: write. Route: POST /api/projects/{projectId}/data/staged/{stagedId}/undo.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
stagedIdstringyesThe staged id.
json
{ "projectId": "Vq3xT8mKp2Lw", "stagedId": "stg_4f1c9a0b7e2d6c35" }
json
{ "ok": true, "deleted": 1, "restored": 1, "errors": [], "staged": { "id": "stg_4f1c9a0b7e2d6c35", "status": "undone" } }

import_status #

Recent staged imports, or one in detail: its plan, result, verification, and every row that wasn't saved with its reason and 1-based source row number.

Scope: read. Route: GET /api/projects/{projectId}/data/imports?staged=&offset=&limit=.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
stagedIdstringnoOne import in detail.
offsetintegernoPaging through problem rows.
limitintegernoProblem rows per page (default 50, up to 250).
json
{ "projectId": "Vq3xT8mKp2Lw", "stagedId": "stg_81d0c2fa9e3b4a71" }
json
{ "ok": true, "text": "stg_81d0c2fa9e3b4a71 · Product · committed · …\nPlan: 120 new, 0 updates, 0 unchanged, 2 with problems · matched on name\nResult: 118 added, 0 updated, 0 unchanged, 2 failed · verified 118 of 118 · undo available\nRows that weren't saved (2; row numbers are the source's, 1-based):\n  row 37: category must be one of bread, pastry, coffee — had name=Flat white, category=drinks\n  …" }

retry_failed #

Stages again only the rows of a committed import that weren't saved, with your fixes, using the same match_on. The result is a new pending stage to review and commit.

Scope: write. Route: POST /api/projects/{projectId}/data/staged/{stagedId}/retry.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
stagedIdstringyesThe committed import.
fixesobjectno{"<source row number>": {field: value}}.
json
{ "projectId": "Vq3xT8mKp2Lw", "stagedId": "stg_81d0c2fa9e3b4a71", "fixes": { "37": { "category": "coffee" } } }
json
{ "ok": true, "text": "Staged stg_2b7e90d1c4a3f856 — Product: 2 new …", "staged": { "id": "stg_2b7e90d1c4a3f856", "status": "pending" } }

verify_import #

Re-reads a committed import's rows now: how many still match what was saved, changed since, or are missing.

Scope: read. Route: GET /api/projects/{projectId}/data/staged/{stagedId}/verify.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
stagedIdstringyesThe committed import.
json
{ "projectId": "Vq3xT8mKp2Lw", "stagedId": "stg_81d0c2fa9e3b4a71" }
json
{ "ok": true, "text": "stg_81d0c2fa9e3b4a71 (Product): 116 of 118 rows still match; 2 changed since (#41 price, #77 name); 0 missing." }

Sources and evidence #

Web content collected into the project stays on the server; the agent gets an id, fields and samples. Imported rows remember their source, so you can trace a page back to where its facts came from and notice when the source changes.

collect_source #

Collects a web page, or with follow the same-site pages it links to (up to 50), into a stored source. Each record has url, title, description, published_at, modified_at, author, image, summary and body. Same web rules as import_url. Import it with stage_data and source_id.

Scope: write. Route: POST /api/projects/{projectId}/sources.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
urlstringyesThe page to start from.
followbooleannoAlso collect the same-site pages it links to.
limitintegernoHow many pages (default 20).
matchstringnoOnly follow links containing this text, e.g. /blog/.
json
{ "projectId": "Vq3xT8mKp2Lw", "url": "https://cornerbakery.example/news", "follow": true, "match": "/news/", "limit": 30 }
json
{ "ok": true, "source": { "id": "src_9a1e0c44b7d2", "url": "https://cornerbakery.example/news", "count": 18 }, "skipped": 2, "sample": [ { "url": "https://cornerbakery.example/news/rye-is-back", "title": "Rye is back", "published_at": "2026-10-02", "summary": "…" } ] }

422 when nothing could be collected.

refresh_source #

Collects a source again without the cache, compares it with what was imported, and flags the changed records and the pages and components showing them. With stage: true it also re-stages the import with the same mapping, for review.

Scope: write. Route: POST /api/projects/{projectId}/sources/{sourceId}/refresh.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
sourceIdstringyesThe source.
stagebooleannoStage the changed rows for import.
json
{ "projectId": "Vq3xT8mKp2Lw", "sourceId": "src_9a1e0c44b7d2", "stage": true }
json
{ "ok": true, "text": "src_9a1e0c44b7d2: 1 changed, 2 new, 0 removed … Staged stg_…", "flags": [ { "id": "…", "kind": "record", "label": "Post #4 Rye is back", "status": "open" } ] }

trace_evidence #

The evidence graph. From a source (sourceId or url): the records imported from it, the pages and components that show them (live, or copied into the code) and the chat answers that cited it. From a record (model + recordId): its sources and pages. From a file (path): its data, their sources, and the chat answers that changed it. With no filter: the sources and open out-of-date flags.

Scope: read. Route: GET /api/projects/{projectId}/evidence.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
sourceIdstringnoA collected source.
urlstringnoA source address.
modelstringnoWith recordId: one record.
recordIdstringnoThe record's id.
pathstringnoA file.
json
{ "projectId": "Vq3xT8mKp2Lw", "path": "src/pages/News.jsx" }
json
{ "ok": true, "text": "src/pages/News.jsx shows Post live (18 records from src_9a1e0c44b7d2) …", "graph": { "…": "…" } }

App files #

Files stored by the app's data API (/_api/<id>/files): pictures, PDFs, ZIPs, video and audio up to 25 MB each, in the account's 1 GB allowance shared with the asset store. Public files are plain URLs; private, users-only and role files open only with the app's sign-in.

app_files #

Lists stored files with their URL, access, type, size, original name and uploader, plus who may upload and the space used.

Scope: read. Route: GET /api/projects/{projectId}/app-files?api_id=&access=.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
apiIdstringnoWhich API.
accessstringnoOnly files with this access: public, private, users or a role.
json
{ "projectId": "Vq3xT8mKp2Lw", "access": "public" }
json
{ "ok": true, "api": { "id": "k2v9…", "name": "Corner Bakery API", "signIn": true, "uploads": "admin", "access": ["public", "private", "users"] }, "files": [ { "url": "https://devmachinist.com/_api/k2v9…/files/3f9c1a2b7e0d4c5a6b8e.jpg", "access": "public", "type": "image/jpeg", "size": 184220, "original": "rye.jpg" } ], "used": 52428800, "quota": 1073741824 }

The list is empty while the API has sign-in off.

store_app_file #

Copies a workspace file (for example something uploaded to public/media/ or uploads/) into the app's file storage and returns its URL, ready for stage_data or sample rows. Needs a connected API with sign-in on (400 otherwise) and an active plan or trial.

Scope: write. Route: POST /api/projects/{projectId}/app-files.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
pathstringyesThe workspace file.
accessstringnopublic (default), private, users or a custom role.
apiIdstringnoWhich API.
json
{ "projectId": "Vq3xT8mKp2Lw", "path": "public/media/allergens.pdf", "access": "users" }
json
{ "ok": true, "name": "p-7d3e…pdf", "url": "https://devmachinist.com/_api/k2v9…/files/p-7d3e…pdf", "access": "users", "type": "application/pdf", "size": 98112 }

Experiments #

An experiment is a safe branch: the workspace is snapshotted and every connected data API copied, and the project points at the copies. Edits, data changes, imports, journeys and the preview then work on the branch while the live site and its data stay as they are. Publishing, app builds and git commits wait until it's finished. One per project.

start_experiment #

Starts an experiment (src/, index.html, package.json and public/, up to 30 MB, plus the data). 409 if one is already running.

Scope: write (and an active plan or trial). Route: POST /api/projects/{projectId}/experiment.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
namestringyesA short name.
goalstringnoWhat it's for.
json
{ "projectId": "Vq3xT8mKp2Lw", "name": "Online pre-orders", "goal": "Let regulars order bread for pickup" }
json
{ "ok": true, "experiment": { "id": "…", "name": "Online pre-orders", "status": "active", "apis": [ { "real": "k2v9…", "copy": "x8p1…" } ], "summary": { "…": "…" } } }

experiment_status #

The running experiment: files added, changed and removed against the snapshot, API definition changes, imports committed on the copies, APIs made during it, and the last checks. Also lists recently finished experiments.

Scope: read. Route: GET /api/projects/{projectId}/experiment.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
json
{ "projectId": "Vq3xT8mKp2Lw" }
json
{ "ok": true, "experiment": { "name": "Online pre-orders", "status": "active" }, "text": "Experiment “Online pre-orders” …\nFiles: 2 added, 3 changed\nData: Order added (5 fields)\n…", "recent": [] }

check_experiment #

Builds the experiment, opens every page and runs the customer journeys on its data, and saves the result as the experiment's checks.

Scope: preview. Route: POST /api/projects/{projectId}/experiment/check.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
json
{ "projectId": "Vq3xT8mKp2Lw" }
json
{ "ok": true, "checks": { "ok": true, "…": "…" }, "experiment": { "…": "…" } }

404 when no experiment is running.

finish_experiment #

Ends the experiment. approve merges it: the code stays, API changes are saved onto the real APIs, new models' rows are copied, and imports committed on the copies are re-planned against today's live rows and committed. discard puts files, pages and data connections back and deletes APIs the experiment made; the real data was never written. Either way the copies and snapshot are deleted.

Scope: write for discard. approve needs the publish scope: the route is on the publish list, so a write-only token gets an isError 403. Route: POST /api/projects/{projectId}/experiment/approve or …/discard.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
actionstringyesapprove or discard.
json
{ "projectId": "Vq3xT8mKp2Lw", "action": "approve" }
json
{ "ok": true, "experiment": { "name": "Online pre-orders", "status": "approved", "…": "…" } }

Git #

Every project can be a git repository. Git runs sandboxed, never force-pushes and never discards work. Remote credentials are set by a person in the builder (More → Git). While an experiment runs, everything except fetch answers 409.

git_status #

Branch, upstream with ahead and behind counts, remotes, local branches, staged, changed and new files, and recent commits, as text. With diff, the diff too (staged changes if any, else everything since the last commit; up to 50,000 characters).

Scope: read. Route: GET /api/projects/{projectId}/git/summary?diff=1&file=.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
diffbooleannoInclude the diff.
filestringnoThe diff of one file.
json
{ "projectId": "Vq3xT8mKp2Lw", "diff": true }
json
{ "ok": true, "text": "Branch main → origin/main (0 ahead, 0 behind; fetch to refresh)\nRemotes: origin https://github.com/dana/corner-bakery.git\nLocal branches: main\nStaged: none\nChanged: src/components/Hero.jsx\nNew: none\nRecent commits:\n  a41c9e2 2026-11-12 Dana: Add menu page\nDiff (all changes since the last commit):\n …" }

git #

One git operation. Push isn't here: use git_push.

Scope: write. Route: POST /api/projects/{projectId}/git/do.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
actionstringyesinit, commit, pull, fetch, branch, checkout, remote_add, remote_set_url or remote_remove.
messagestringnoCommit message (required for commit; for init, the first commit's).
filesarray of stringsnocommit: only these paths (default: everything).
remotestringnoRemote name (default origin).
urlstringnoremote_add, remote_set_url: the remote's URL.
branchstringnopull: the remote branch.
namestringnobranch, checkout: the branch name.
checkoutbooleannobranch: switch to it (default true).
rebasebooleannopull: rebase instead of fast-forward only.
json
{ "projectId": "Vq3xT8mKp2Lw", "action": "commit", "message": "Show opening hours in the hero" }
json
{ "ok": true, "text": "Committed 7be04d1 Show opening hours in the hero" }

init starts on branch main with a first commit. Pull, fetch and push refuse a remote that doesn't exist.

git_commit_message #

Writes a commit message for the current changes (or only these files) in the style of the repository's log, using your AI. Uses your AI allowance and credits.

Scope: write. Route: POST /api/projects/{projectId}/git/message.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
filesarray of stringsnoDescribe only these files (up to 10).
json
{ "projectId": "Vq3xT8mKp2Lw" }
json
{ "ok": true, "message": "Show opening hours in the hero\n\nVisitors asked when the shop opens; the hero now says it\nunder the tagline.", "tokens": 1840 }

400 There are no changes to describe on a clean tree.

git_push #

Pushes a branch to a remote, never forced.

Scope: publish. Route: POST /api/projects/{projectId}/git/push.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
remotestringnoDefault origin.
localBranchstringnoDefault: the current branch.
remoteBranchstringnoDefault: the same name.
setUpstreambooleannoSet the upstream (-u).
json
{ "projectId": "Vq3xT8mKp2Lw", "setUpstream": true }
json
{ "ok": true, "output": "To https://github.com/dana/corner-bakery.git\n   a41c9e2..7be04d1  main -> main", "remote": "origin", "localBranch": "main", "remoteBranch": "main" }

When git refuses (no credentials, the remote moved on), the result is an isError with git's output. 40 pushes, pulls and fetches per 10 minutes.

Connected databases and apps #

A project can connect external PostgreSQL and MySQL/MariaDB databases and apps such as Google Sheets or Airtable (Connections). Credentials are entered only by a person in the builder and never returned; tools take the connection's conn_… id. Connections are read-only until a person allows changes, and every change is staged for a person to approve: tokens can't approve database changes or start transfers.

list_connectors #

What the project can connect to, each connector's operations (read, import, write), the project's connections with their ids and access, and open connection requests.

Scope: read. Route: GET /api/projects/{projectId}/connections.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
json
{ "projectId": "Vq3xT8mKp2Lw" }
json
{ "ok": true, "connections": [ { "id": "conn_3c9f1a0e7b25d4", "kind": "database", "engine": "postgres", "label": "Shop database", "access": "read" } ], "requests": [], "connectors": [ { "id": "google-sheets", "label": "Google Sheets", "…": "…" } ] }

inspect_database #

A connected database: engine, version, privileges and tables; with table, its columns, keys, relationships both ways, row count and first rows. For an app connection, its resources, or one resource with resource.

Scope: read. Route: GET /api/projects/{projectId}/connections/{connection_id}/inspect?table=&resource=.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
connection_idstringyesThe connection.
tablestringnoOne table (databases).
resourcestringnoOne resource (apps).
json
{ "projectId": "Vq3xT8mKp2Lw", "connection_id": "conn_3c9f1a0e7b25d4", "table": "orders" }
json
{ "ok": true, "text": "orders — 4,812 rows\n  id integer PK · customer_id integer → customers.id · total numeric · created_at timestamptz …", "data": { "…": "…" } }

query_database #

Runs one read-only SQL statement on a connected database, inside a read-only transaction with a time limit, paged.

Scope: read (although it's a POST). Route: POST /api/projects/{projectId}/connections/{connection_id}/query.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
connection_idstringyesThe connection.
sqlstringyesOne SELECT-style statement.
paramsarraynoValues for the statement's placeholders.
limitintegernoRows per page, up to 250.
offsetintegernoFor paging.
timeout_msintegernoUp to 20,000.
explainbooleannoReturn the query plan.
json
{ "projectId": "Vq3xT8mKp2Lw", "connection_id": "conn_3c9f1a0e7b25d4", "sql": "select id, total from orders where created_at > $1 order by total desc", "params": ["2026-11-01"], "limit": 10 }
json
{ "ok": true, "text": "10 rows …", "rows": [ { "id": 4801, "total": "86.40" } ] }

stage_database_changes #

Previews inserts, updates, deletes or schema changes on a connected database without writing anything. A person approves it in the builder; it's refused then if the tables or affected rows changed since the preview. Up to 20 changes, 2,000 rows per update or delete, 5,000 per insert.

Scope: write. Route: POST /api/projects/{projectId}/connections/{connection_id}/stage.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
connection_idstringyesThe connection.
changesarrayyesChange objects (below).

Changes: {"op": "insert", "table", "rows": [ … ]} (or row); {"op": "update", "table", "set": {column: value}, "where"}; {"op": "delete", "table", "where"}; {"op": "schema", "sql"}. where is required for updates and deletes: an object {column: value} or a list of {column, op, value} with ops eq, ne, lt, lte, gt, gte, like, in, null, notnull. Primary keys can't be changed by an update.

json
{ "projectId": "Vq3xT8mKp2Lw", "connection_id": "conn_3c9f1a0e7b25d4", "changes": [ { "op": "update", "table": "products", "set": { "price": 3.4 }, "where": { "sku": "CRS-01" } } ] }
json
{ "ok": true, "staged": { "id": "dbs_5e0a1c93d7b2f4", "status": "pending", "summary": "update products: 1 row" }, "text": "Staged dbs_5e0a1c93d7b2f4 … A person approves it in the builder." }

plan_database_migration #

Plans a server-to-server transfer between a connected database table and the project's data model (in either direction): column mapping, incompatible or lossy types, constraints, and what to do with rows that already exist. A person approves and starts it in the builder.

Scope: write. Route: POST /api/projects/{projectId}/connections/migrations.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
sourceobjectyes{connection_id, table} or {model}.
destinationobjectyes{connection_id, table} or {model}.
mappingobjectnoDestination column → source column (default: by name).
match_onarray of stringsnoColumns that identify an existing row.
conflictstringnoskip (default), update or error.
batchintegernoRows per batch (default 500).
json
{ "projectId": "Vq3xT8mKp2Lw", "source": { "connection_id": "conn_3c9f1a0e7b25d4", "table": "products" }, "destination": { "model": "Product" }, "mapping": { "name": "title", "price": "price" }, "match_on": ["name"], "conflict": "update" }
json
{ "ok": true, "migration": { "id": "mig_7c2d9e0a4b1f63", "status": "planned" }, "text": "Shop database products → Product: 212 rows … name ← title, price ← price … Waiting for approval." }

migration_status #

Progress of a transfer: rows read, added, updated, skipped and failed, failures, and the read-back verification at the end.

Scope: read. Route: GET /api/projects/{projectId}/connections/migrations/{migration_id}.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
migration_idstringyesThe migration.
json
{ "projectId": "Vq3xT8mKp2Lw", "migration_id": "mig_7c2d9e0a4b1f63" }
json
{ "ok": true, "migration": { "id": "mig_7c2d9e0a4b1f63", "status": "done", "progress": { "read": 212, "inserted": 40, "updated": 172, "skipped": 0, "failed": 0 } }, "text": "…" }

Issues #

Each project has numbered issues with comments, shared with everyone who can open it. Creating, closing and commenting notify collaborators. Issue and comment writes are limited to 120 per 10 minutes.

list_issues #

Issues on the project, with counts.

Scope: read. Route: GET /api/projects/{projectId}/issues?status=.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
statusstringnoopen or closed.
json
{ "projectId": "Vq3xT8mKp2Lw", "status": "open" }
json
{ "ok": true, "issues": [ { "number": 4, "title": "Menu prices are out of date", "status": "open", "labels": ["content"], "author": { "username": "dana" }, "comments": 2 } ], "counts": { "open": 1, "closed": 3 } }

get_issue #

One issue with its comments.

Scope: read. Route: GET /api/projects/{projectId}/issues/{number}.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
numberintegeryesThe issue number.
json
{ "projectId": "Vq3xT8mKp2Lw", "number": 4 }
json
{ "ok": true, "issue": { "number": 4, "title": "Menu prices are out of date", "body": "Croissants are 3.40 now.", "status": "open" }, "comments": [ { "body": "Fixed in the sheet, re-import please", "username": "sam" } ] }

create_issue #

Opens an issue. Title 3 to 200 characters, body up to 20,000, up to 8 labels of 24 characters. @username mentions in the body notify those people.

Scope: write. Route: POST /api/projects/{projectId}/issues.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
titlestringyesThe title.
bodystringnoThe description.
labelsarray of stringsnoLabels.
json
{ "projectId": "Vq3xT8mKp2Lw", "title": "Visit page has no map", "body": "Add the address and a link to directions.", "labels": ["content"] }
json
{ "ok": true, "issue": { "number": 5, "title": "Visit page has no map", "status": "open" } }

update_issue #

Changes an issue's status, title or body. Labels can't be changed through this tool; the REST route takes labels and assignee.

Scope: write. Route: PATCH /api/projects/{projectId}/issues/{number}.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
numberintegeryesThe issue number.
statusstringnoopen or closed.
titlestringnoA new title.
bodystringnoA new description.
json
{ "projectId": "Vq3xT8mKp2Lw", "number": 5, "status": "closed" }
json
{ "ok": true, "issue": { "number": 5, "status": "closed", "closed_at": "2026-11-13T10:22:08.000Z" } }

comment_on_issue #

Adds a comment (up to 10,000 characters) to an issue and notifies its author, collaborators and anyone mentioned.

Scope: write. Route: POST /api/projects/{projectId}/issues/{number}/comments.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
numberintegeryesThe issue number.
bodystringyesThe comment.
json
{ "projectId": "Vq3xT8mKp2Lw", "number": 5, "body": "Added the address and a directions link on the Visit page; published." }
json
{ "ok": true, "comment": { "id": "…", "body": "Added the address and a directions link on the Visit page; published.", "username": "dana" } }

The in-app AI chat's tools #

These are the tools the AI in the builder's chat uses, available to agents under the same names. Each one runs the same code as in the chat, through POST /api/projects/{projectId}/tools/<name> with the arguments (without projectId) as the JSON body, and answers {"ok": true, "tool": "<name>", "result": "<text>"}. Writes claim the files they touch, so a file held by another AI or agent comes back 423 with who holds it. This goes for every write route an agent calls, not only these: each file an agent writes is held for its token until it has made no call for 3 minutes (15 with a declared plan) or calls release_plan. The per-answer quotas of a chat answer apply to each call (for example at most 4 package installs). See AI chat tools for how the chat itself uses them.

Finding your way.

Search the project's files for text (or a regular expression). Returns path:line: text for each match. Use it to find where something is before reading.

Scope: read. Route: POST /api/projects/{projectId}/tools/search.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
querystringyes—
regexbooleannoTreat query as a regular expression
pathstringnoOnly search this file or folder (optional)
json
{"projectId":"Vq3xT8mKp2Lw","query":"useProducts"}
json
{ "ok": true, "tool": "search", "result": "src/components/ProductGrid.jsx:3: import { useProducts } from '../api/shop.js'\nsrc/pages/Shop.jsx:12: …" }

get_context #

Fetch project knowledge on demand instead of guessing: "components" (props and exact import lines; pass names to get only those), "design" (the design system classes), "data" (data hooks, endpoints and rules of the connected APIs), "auth" (sign-in components and roles), "files" (the app’s file storage: who can upload, what’s stored, how pages upload and show public and private files), "structure" (page links and file rules), "modules" (helpers and installed packages), "graphics" (how to build 3D / WebGL / canvas scenes here with React Three Fiber — read it before any 3D work), "tools" (every tool’s limits, transaction and retry guarantees).

Scope: read. Route: POST /api/projects/{projectId}/tools/get_context.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
topicstring (components, design, data, auth, files, structure, modules, graphics, connections, game, tools)yes—
namesarray of stringno—
json
{"projectId":"Vq3xT8mKp2Lw","topic":"components","names":["ProductCard"]}
json
{ "ok": true, "tool": "get_context", "result": "Project context\nComponents:\n- ProductCard … import ProductCard from '../components/ProductCard.jsx' …\n(map version as of now: 3f9a1c)" }

game_status #

The project's multiplayer game servers (rooms in server/, Colyseus 0.18): whether the dev server (the preview) and the live server (the published site) run, how many players are connected, and their recent output — errors from the rooms with file and line, and console.log lines. Read it after changing server/: the dev server restarts by itself when a file there changes, and starts on the first player while the preview runs. get_context {topic: "game"} explains how rooms, state and the client work here.

Scope: read. Route: POST /api/projects/{projectId}/tools/game_status (also GET /api/projects/{projectId}/game).

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
json
{"projectId":"Vq3xT8mKp2Lw"}
json
{ "ok": true, "tool": "game_status", "result": "dev: running, 2 connected, since 2026-11-18T21:20:04.000Z\n  last output:\n  21:20:04 Game server (dev) ready with rooms: lobby, arena\nlive: stopped — it starts on the first player after publishing" }

get_api #

Show the project's data API (the one the API designer edits): models with every field (type, required, unique, enum values, references), access rules and whether sign-in is on.

Scope: read. Route: POST /api/projects/{projectId}/tools/get_api.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
api_idstringnoOnly when the project has more than one API (optional)
json
{"projectId":"Vq3xT8mKp2Lw"}
json
{ "ok": true, "tool": "get_api", "result": "API Shop (api_8k2f…): sign-in on\nProduct: name string required, price float, …\nrules: Product read public, write admin …" }

ai_activity #

What else is happening in this project right now: other people's AI answers and builds (their goal, plan and the files and APIs they hold) and who has which file open. Check it before a change when other AI work is running, and again if a file you need was refused as held.

Scope: read. Route: POST /api/projects/{projectId}/tools/ai_activity.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
json
{"projectId":"Vq3xT8mKp2Lw"}
json
{ "ok": true, "tool": "ai_activity", "result": "No other AI work is running in this project.\n\nPeople in the project now: Dana (editing src/pages/Home.jsx)" }

find_sources #

List this project's collected sources, or search inside them (query) — articles and pages collected earlier, in any chat.

Scope: read. Route: POST /api/projects/{projectId}/tools/find_sources.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
querystringno—
json
{"projectId":"Vq3xT8mKp2Lw","query":"opening hours"}
json
{ "ok": true, "tool": "find_sources", "result": "- Visit us · no date · src_9a1e0c44b7d2\n  Open Tuesday to Sunday, 7am to 3pm …" }

Files and packages.

create_file #

Create a NEW file: a component in src/components/<Name>.jsx, a page in src/pages/<Name>.jsx, a module in src/lib/utils/hooks, a 3D scene in src/scenes, a shader in src/shaders (a .js module exporting the GLSL string), a stylesheet in src/styles (.css) or data in src/data (.json). Fails if it already exists — edit existing files instead.

Scope: write. Route: POST /api/projects/{projectId}/tools/create_file.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
pathstringyesFile path in the project, e.g. src/components/Hero.jsx
contentstringyes—
json
{"projectId":"Vq3xT8mKp2Lw","path":"src/lib/money.js","content":"export const money = (n) => `$${Number(n).toFixed(2)}`\\n"}
json
{ "ok": true, "tool": "create_file", "result": "Created src/lib/money.js" }

rename_file #

Move or rename a module in src/lib/utils/hooks/scenes/shaders/styles/data (not components or pages). Then fix the imports the result lists.

Scope: write. Route: POST /api/projects/{projectId}/tools/rename_file.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
fromstringyes—
tostringyes—
json
{"projectId":"Vq3xT8mKp2Lw","from":"src/lib/money.js","to":"src/lib/format.js"}
json
{ "ok": true, "tool": "rename_file", "result": "Renamed src/lib/money.js → src/lib/format.js. Update the imports in: src/components/ProductCard.jsx." }

install_package #

Install npm packages the change really needs (e.g. three @react-three/fiber @react-three/drei for 3D, recharts for charts). Public registry, install scripts never run; at most 4 calls per answer. Check get_context {topic: "modules"} first — don't install what is there or what a few lines of code can do. Undo removes them.

Scope: write. Route: POST /api/projects/{projectId}/tools/install_package.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
packagesarray of stringyesNames, optionally with a version: ["three", "@react-three/fiber@9"]
json
{"projectId":"Vq3xT8mKp2Lw","packages":["recharts"]}
json
{ "ok": true, "tool": "install_package", "result": "Installed recharts@3.2.1. Import them normally." }

remove_package #

Uninstall npm packages the project no longer imports.

Scope: write. Route: POST /api/projects/{projectId}/tools/remove_package.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
packagesarray of stringyes—
json
{"projectId":"Vq3xT8mKp2Lw","packages":["recharts"]}
json
{ "ok": true, "tool": "remove_package", "result": "Removed recharts." }

Data API and pages.

change_api #

Change the project's data API through the API designer (never edit the files in src/api/ — those files are regenerated from it). Use it whenever a change needs new data: add models or fields, change a field, set who may read/write a model, turn on sign-in, add sample rows to an empty model. Removing a model or field hides it from the API but keeps its stored data. Creates and connects an API when the project has none (needs add_models). The generated hooks and src/api clients update right away.

Scope: write. Route: POST /api/projects/{projectId}/tools/change_api.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
api_idstringnoOnly when the project has more than one API (optional)
add_modelsarray of objectno—
add_fieldsarray of objectno—
change_fieldsarray of objectnoOnly the properties given change
remove_fieldsarray of objectno—
remove_modelsarray of stringno—
rulesarray of objectnoWho may see (read), add (create) and change/delete (write) a model's rows: public, auth, owner, admin, none or a custom role name (auth = signed in, owner = the signed-in owner of the row via user_id, admin = admin role, a role = that role and admins, none = builder only). Match them to what the pages do: a public form → create public with read/write admin. Anything but public/none needs sign-in.
rolesarray of stringnoCustom roles to add besides user and admin (lowercase, e.g. editor, member). Give accounts a role in API → Auth → Users.
sign_inbooleannotrue turns on sign-in (accounts, useAuth, LoginForm, <Auth role>)
uploadsstringnoWho may upload files through the app (uploadFile): admin (default), user (any signed-in account — e.g. customers attaching documents or profile photos) or a custom role. Turns sign-in on.
sample_rowsarray of objectnoRows for models that are still empty
json
{"projectId":"Vq3xT8mKp2Lw","add_fields":[{"model":"Product","name":"featured","type":"boolean"}]}
json
{ "ok": true, "tool": "change_api", "result": "Done: added Product.featured.

API Shop (api_8k2f…): …" }

check_access #

Check the data API's access rules for problems: anyone able to change or delete rows, personal data readable by the public, rules that need sign-in while it's off. Run it after data or permission changes; fix what it finds with change_api.

Scope: read. Route: POST /api/projects/{projectId}/tools/check_access.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
api_idstringno—
json
{"projectId":"Vq3xT8mKp2Lw"}
json
{ "ok": true, "tool": "check_access", "result": "No access problems found." }

set_page_access #

List or delist a page in the site menu (site.js) and set who may open it: roles [] = everyone, ["user"] = any signed-in account, ["admin"] = admins, or a custom role. The router gates it; navs show it through pagesFor(user).

Scope: write. Route: POST /api/projects/{projectId}/tools/set_page_access.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
pagestringyesPage name, e.g. Dashboard
listedbooleanno—
rolesarray of stringno—
json
{"projectId":"Vq3xT8mKp2Lw","page":"Dashboard","listed":false,"roles":["user"]}
json
{ "ok": true, "tool": "set_page_access", "result": "Dashboard: not in the menu, …" }

The web.

read_url #

Read a web page the person mentions (or one linked from it): its text, headings, links, images and a design summary from its stylesheets (colors, fonts, CSS variables, sizes, radii, shadows). mode "css" gives the condensed CSS, mode "text" a file's raw text (a script, JSON). Read only what the request needs.

Scope: read. Route: POST /api/projects/{projectId}/tools/read_url.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
urlstringyes—
modestring (page, css, text)no—
json
{"projectId":"Vq3xT8mKp2Lw","url":"https://example.com","mode":"page"}
json
{ "ok": true, "tool": "read_url", "result": "Example Domain\nHeadings: …\nText: …\nDesign: colors …, fonts …" }

Working alongside others.

declare_plan #

Before changing more than one file (or any data API), say what you will do and which files and APIs you will change. They are held for you until this answer ends, so other people's AIs working in this project leave them alone, and people see your plan live. Files another AI already holds come back as taken — plan around them. Call it again if the plan changes. The plan stays held for this token until release_plan or 15 minutes without a call; your own writes pass it.

Scope: write. Route: POST /api/projects/{projectId}/tools/declare_plan.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
summarystringyesThe plan in 1–3 plain sentences
filesarray of stringnoProject paths you will change or create
api_idsarray of stringnoData APIs whose models or rules you will change
json
{"projectId":"Vq3xT8mKp2Lw","summary":"Add a featured products row to Home","files":["src/pages/Home.jsx","src/components/FeaturedRow.jsx"]}
json
{ "ok": true, "tool": "declare_plan", "result": "Plan saved; people in the project can see it. Held for you until release_plan or 15 minutes without a call: src/pages/Home.jsx, src/components/FeaturedRow.jsx." }

release_plan #

Release everything this token holds in the project — the files it wrote and its declared plan — so people and other AIs can edit them again. Call it when you finish (holds also lapse after 3 quiet minutes, 15 with a plan).

Scope: write. Route: DELETE /api/projects/{projectId}/tools/plan.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
json
{"projectId":"Vq3xT8mKp2Lw"}
json
{ "ok": true, "released": true }

Memory and questions.

remember #

Save something about this project for future conversations: a decision, a fact about the business, or a preference. It's stored as your suggestion until the person confirms it — save what they told you or what you were sure about, not guesses.

Scope: write. Route: POST /api/projects/{projectId}/tools/remember.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
kindstring (decision, fact, preference)yes—
textstringyes—
whystringno—
json
{"projectId":"Vq3xT8mKp2Lw","kind":"fact","text":"The bakery closes on Mondays","why":"The owner said so"}
json
{ "ok": true, "tool": "remember", "result": "Saved as a suggestion (#4) — the person can confirm it in Memory." }

ask_question #

Queue a question you need the person to answer instead of inventing a requirement. Rank it by what a wrong guess would cost (high / medium / low) and offer short options when you can. Ask the highest-impact ones first and only what you need.

Scope: write. Route: POST /api/projects/{projectId}/tools/ask_question.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
questionstringyes—
whystringno—
impactstring (high, medium, low)yes—
optionsarray of stringno—
json
{"projectId":"Vq3xT8mKp2Lw","question":"Should orders be picked up or delivered?","impact":"high","options":["Pickup only","Delivery too"]}
json
{ "ok": true, "tool": "ask_question", "result": "Queued question #5 (high). Ask it in your reply too, then wait for the answer instead of guessing." }

Connections.

connect_database #

Ask the person to connect an external database. It puts a secure connection-string form in the chat — you NEVER see, ask for or repeat a password or connection string. You get a credential-free connection id (conn_…) once they finish; then stop and wait. Connections start read-only.

Scope: write. Route: POST /api/projects/{projectId}/tools/connect_database.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
enginestring (postgres, mysql)noIf known (optional)
labelstringnoA short name, e.g. "Old shop database"
whystringnoOne sentence the person sees: what you will use it for
json
{"projectId":"Vq3xT8mKp2Lw","engine":"postgres","label":"Old shop database","why":"To move the product list over"}
json
{ "ok": true, "tool": "connect_database", "result": "Asked the person to connect a PostgreSQL database (request creq_…) … The person finds the form in the builder: ✦ AI → Chat, in any chat of this project." }

connect_app #

Ask the person to link an app by signing in to it (a button in the chat). No keys or tokens are typed. list_connectors shows which are available.

Scope: write. Route: POST /api/projects/{projectId}/tools/connect_app.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
connectorstringyesA connector id from list_connectors, e.g. google-sheets
labelstringno—
whystringno—
json
{"projectId":"Vq3xT8mKp2Lw","connector":"google-sheets","why":"To import the price list"}
json
{ "ok": true, "tool": "connect_app", "result": "Asked the person to sign in to Google Sheets (request creq_…) …" }

inspect_connection #

What an app connection can reach (its sheets, tables or databases), or with resource one resource's fields and first rows. Import a resource with stage_data {model, connection_id, resource, mapping_json, match_on} — the rows go server to server.

Scope: read. Route: POST /api/projects/{projectId}/tools/inspect_connection.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
connection_idstringyes—
resourcestringnoA resource id from the listing (optional)
json
{"projectId":"Vq3xT8mKp2Lw","connection_id":"conn_3c9f1a0e7b25d4","resource":"inbox"}
json
{ "ok": true, "tool": "inspect_connection", "result": "inbox — 12 rows … fields: name, email, message …" }

run_database_migration #

Continue a transfer the person already approved that failed, was stopped or was interrupted (it resumes from the last saved batch). A planned migration is started only by the person, with Approve on its card — this tool then just reports that it is waiting.

Scope: write. Route: POST /api/projects/{projectId}/tools/run_database_migration.

ArgumentTypeRequiredMeaning
projectIdstringyesThe project.
migration_idstringyes—
json
{"projectId":"Vq3xT8mKp2Lw","migration_id":"mig_…"}
json
{ "ok": true, "tool": "run_database_migration", "result": "Resumed.
…progress of the transfer…" }