mcp
v0.111.0BetterCMS MCP server — schema, content, forms + components authoring tools over the Management API, authed via OAuth device-code.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
list_pages List pages in the current project
List the pages in the project this MCP key is bound to, each with its id, `path`, `language`, full field SCHEMA, pageType (singleton|dynamic), and status. Use it to verify WHERE content lands and to read field keys/types before set_page_content / add_field.
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
get_page Get a page (with its field schema)
Get one page INCLUDING its full field schema (keys, types, nested group/repeater children), pageType, `path` and `language`. A field with `stale: true` is one the build no longer renders: kept, hidden in the editor. `entryDraft.draftPending`: its field values have unpublished edits (`keys`). Read this before set_page_content so you write correctly-keyed values, or before add_field so you know the existing keys.
| Parameter | Type | Description |
|---|---|---|
pageId * | string | page id or path ('/de/about'); a bare slug only when one page has it |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
create_page Create a page
Create a page with its own typed schema. Supports pageType 'singleton' (exactly one entry — Home, About, Contact) and 'dynamic' (many entries sharing the schema — Blog posts, Products). Project-scoped from the key. Additive — does not delete or overwrite existing pages. FIRST read the page's real markup and DECOMPOSE it into a destructured tree: each visual section becomes a nested field — a fixed grouped block → type 'group', a repeating list of items (cards, testimonials, features, FAQs) → type 'repeater' — each carrying its own child `fields`. Do NOT flatten sections into many…
create_content_model Create a content model (reusable schema)
Create a content model — a reusable schema for a dynamic collection (Blog, Products, Testimonials). A collection is only for items one template route repeats (/blog/:slug: set urlPattern). A single page's copy (home, about, contact, pricing, legal) is page fields in sections (add_field with pageId / set_page_content), never a one-entry collection. `fields` may NEST: type 'group' = one nested object of child fields; type 'repeater' = a repeatable array of child objects. Put child fields in each group/repeater's own `fields` (any depth). Pass kind:'block' to create a BLOCK type instead — see…
add_field Add a field to a content model or a page
Append ONE field to a content model (`modelId`) or to a page's schema (`pageId`) — additive, never overwrites; a key already in use is refused. For a section/zone add ONE 'group' (fixed block) or 'repeater' (repeating list) carrying its child `fields`, not the zone's inner fields as separate top-level fields. Pass `after` to insert it after an existing top-level field instead of at the end; key 'a.b' adds b inside group/repeater a (after: a sibling); `ui`, `helpText`, `showIf`, `placement` and `fieldsetId` declare how it presents in the editor — read them back with get_content_model or get…
create_content_entry Create a content entry
Create a content entry under a model. A collection is only for items one template route repeats (/blog/:slug: set urlPattern). A single page's copy (home, about, contact, pricing, legal) is page fields in sections (add_field with pageId / set_page_content), never a one-entry collection. Pass its field VALUES in `data`, keyed by field key — INCLUDE ALL REQUIRED FIELDS (create validates them). New entries are drafts; pass status:'published' to take it live. Read get_content_model first for the field keys and which are required. One entry per call: for volume, run code against the Management AP…
| Parameter | Type | Description |
|---|---|---|
contentModelId * | string | id of the model this entry belongs to |
branchId | string | content branch id (from list_branches); omit to work on main |
data | object | field values keyed by field key |
dryRun | boolean | validates and reports what would be written; writes nothing |
externalKey | string | id in the source system; sent again, it updates that entry's draft or leaves it unchanged |
locale | string | null | language, a BCP-47 tag (zh-CN → zh-cn), one of the project's locales; null = the default |
projectId | string | list_projects id; workspace-wide grants only |
runId | string | your run's id, kept with the entry |
slug | string | |
source | string | source URL, kept with the entry |
status | string | defaults to draft |
translationOf | string | null | the SOURCE id this translates (never a translation); null unlinks. One per locale: the translation sets locale and translationOf |
set_page_content Set a page's field values (content)
Set a page's field VALUES — the actual content. For a SINGLETON page (Home, About, Site Settings) this creates or updates its one entry, so call it again to edit. `data` is keyed by field key: a nested 'array' (zone) value is an OBJECT { nonRepeatable: { childKey: value }, repeatable: [ { childKey: value } ] }; a primitive 'array' is a plain list; an 'image' value is an asset URL or { url, altText?, focal?, crop? } — focal {x,y} and crop {top,right,bottom,left} (0–1, cut from each edge) frame THIS placement only. Read the schema first with get_page. This is how you populate Home/About/Se…
| Parameter | Type | Description |
|---|---|---|
data * | object | field values keyed by field key. A nested 'array' (zone) value is an OBJECT { nonRepeatable: { childKey: value, … }, repeatable: [ { childKey: value }, … ] } — nonRepeatable holds the fixed-bloc… |
pageId * | string | page id or path ('/de/about'); a bare slug only when one page has it |
branchId | string | content branch id (from list_branches); omit to work on main |
ifMatch | integer | get_page optimisticVersion; required with replace on a page whose sections hold its copy |
projectId | string | list_projects id; workspace-wide grants only |
replace | boolean | true replaces the whole entry data, removing omitted fields; default false merges by top-level key |
status | string | omit to leave status unchanged |
list_content_entries List content entries (incl. drafts)
List content entries — including drafts — filtered by model and/or page, by field values (`where`), sorted and paged. Use it to SEE existing content before editing. For a singleton page, pass its pageId to get its single entry. A project-scoped connection sees its own project's entries plus workspace-level ones, which it can read but not change. Returns `limit` entries per `page` (50 by default); the summary says which page of how many. Each entry is a SUMMARY (id, slug, title, status, model, page, dates, optimisticVersion, pendingChanges) — read values with get_content_entry, or pass `d…
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
countOnly | boolean | true = only meta.total, no rows |
detail | boolean | true = full rows with every field value and the published copy. Large: read one entry with get_content_entry instead. |
expand | array | up to 5 top-level reference fields to inline as {id, slug, title, modelId} |
externalKey | string | exact externalKey an entry was created with |
fields | array | up to 30 top-level field keys: only those values come back |
ids | array | up to 100 entry ids, all on one page; meta.notFound lists the ones missing |
limit | integer | entries per page, 1-200; 50 when omitted. Read `meta.totalPages` and ask for the next `page`. |
modelId | string | filter by content model id |
modelSlug | string | the collection by slug, instead of modelId |
page | integer | 1-based page of `limit` rows; the response's meta says totalPages |
pageId | string | filter by page id (a singleton page has one entry) |
perspective | string | 'draft' (the default: the working copy) or 'published' (the live copy) |
projectId | string | list_projects id; workspace-wide grants only |
sort | string | comma list, a leading - sorts descending, e.g. '-publishedAt,title' |
status | string | |
where | object | field filters: {field: value} is equality, {field: {op: value}} with op eq|ne|gt|gte|lt|lte|contains|in, and an array means `in`. System fields slug, status, publishedAt, locale work anywhere; a data… |
get_content_entry Get a content entry (with its values)
Get one content entry by id INCLUDING its `data` (field values), even when draft.
| Parameter | Type | Description |
|---|---|---|
entryId * | string | content entry id |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
update_content_entry Update a content entry's values
Update a content entry's `data` (field values) and/or status by id. `data` is keyed by field key; a nested 'array' (zone) value is an object { nonRepeatable: {…}, repeatable: [{…}] }, a primitive 'array' is a plain list; an image value may carry this placement's focal {x,y} and crop {top,right,bottom,left} (0–1). Use this to edit an existing entry; for a singleton page prefer set_page_content. `data` MERGES into the stored values by top-level key: a field you leave out is kept, null clears one, and a group or repeater value replaces that whole key. 🔴 merge:false REPLACES the whole val…
| Parameter | Type | Description |
|---|---|---|
entryId * | string | content entry id |
branchId | string | content branch id (from list_branches); omit to work on main |
data | object | field values keyed by field key |
ifMatch | integer | optimisticVersion from get_content_entry: the write applies only at that version, and a 409 means it changed since: read it again and re-apply. With merge it defaults to the version merge read. |
locale | string | null | language, a BCP-47 tag (zh-CN → zh-cn), one of the project's locales; null = the default |
merge | boolean | Default true: keep the fields you leave out. The entry is read, `data` is laid over its stored data by top-level key (a group or repeater value replaces that whole key) and written at the version read… |
meta | object | the entry's native SEO; merges into what is stored |
projectId | string | list_projects id; workspace-wide grants only |
scheduledAt | ISO datetime to publish this draft at (needs publish permission); null cancels. An edit that omits scheduledAt CANCELS a pending publish schedule, so send it again with every edit made before it fires… | |
slug | string | |
status | string | |
translationOf | string | null | the SOURCE id this translates (never a translation); null unlinks. One per locale: the translation sets locale and translationOf |
unpublishAt | ISO datetime at which the published entry returns to draft; null cancels. Omitting it never cancels it. |
upload_asset Upload an asset to the Media Library
Upload an image/asset from a local file path or a remote URL into the project's Media Library, or have the server fetch a public `sourceUrl` itself. Returns the asset's stable CDN URL — put that URL into a content entry's image field. Use this BEFORE creating entries that reference images.
| Parameter | Type | Description |
|---|---|---|
altText | string | accessibility alt text |
branchId | string | content branch id (from list_branches); omit to work on main |
caption | string | |
filename | string | override the stored filename |
folderId | string | target Media Library folder (defaults to project root) |
localPath | string | absolute path to a local file (e.g. a repo image); provide this OR url |
projectId | string | list_projects id; workspace-wide grants only |
sourceUrl | string | instead of data: a public http(s) URL the server fetches and stores (private or internal addresses are refused) |
transcript | string | video/audio only: the spoken words (≤ 100,000 chars), published wherever the file is used |
url | string | remote image URL this client downloads and uploads; provide this OR localPath OR sourceUrl |
delete_page Delete a page
DELETE a page and its content. Destructive but REVERSIBLE — it soft-deletes (can be restored from the dashboard) and is audit-logged. Use it to remove a page you created by mistake. Confirm with the user before deleting content they may want. Or, with no pageId, `runtimeBundle`: 'report' lists the duplicate pages derived from a server app's own bundle (`app/` folders); 'apply' retires them and their empty folders.
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
pageId | string | id of the page to delete (from list_pages) |
projectId | string | list_projects id; workspace-wide grants only |
runtimeBundle | string | instead of pageId: the server-app bundle cleanup |
delete_content_entry Delete a content entry
DELETE a single content entry. Destructive but REVERSIBLE (soft-delete, restorable from the dashboard) and audit-logged. Use it to remove content created by mistake.
| Parameter | Type | Description |
|---|---|---|
entryId * | string | id of the content entry to delete (from list_content_entries) |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
delete_content_model Delete a content model
Delete a content model and its entries (soft delete, reversible). Run dryRun first: it returns the entry counts and `referencedBy`, the fields of other models, pages or components that point at it. A model still referenced is refused 409 MODEL_IN_USE unless allowDangling is true.
| Parameter | Type | Description |
|---|---|---|
modelId * | string | id of the content model to delete (from list_content_models) |
allowDangling | boolean | true = delete although other models still reference it; their reference fields then point at nothing |
branchId | string | content branch id (from list_branches); omit to work on main |
dryRun | boolean | true = report the entry counts and referencedBy; delete nothing |
projectId | string | list_projects id; workspace-wide grants only |
list_forms List forms in the current project
List the forms built in the dashboard for the bound project — each with its id, name, and field schema. Use it to find a form to add to the user's site: read it, then write `<BcmsForm form={getForm('Name')} />` (from @bettercms-ai/next) into the page/component where the user wants it.
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
get_form Get a form (with its field schema)
Get one form by id INCLUDING its fields (keys, types, required, options, showIf) and settings. Read this before wiring `<BcmsForm>` so you render the right fields.
| Parameter | Type | Description |
|---|---|---|
formId * | string | form id (from list_forms) |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
create_form Create a form
Create a form in the connected project from a field schema. Confirm the fields with the user first. select, radio and checkboxes need options; step divides pages; file needs a form on a site. Returns the new form's id. It is created PUBLISHED when this connection may publish; otherwise it lands as a DRAFT (a draft form returns 403 on submit) — check `status` and call publish_form, or let the user publish it. A draft form placed on a page also goes live when that page is published.
| Parameter | Type | Description |
|---|---|---|
name * | string | human form name (used by getForm('Name')) |
branchId | string | content branch id (from list_branches); omit to work on main |
description | string | |
fields | array | the form's fields |
honeypotField | name of a hidden honeypot input; a submission that fills it is marked spam. null clears | |
notifyEmails | array | addresses emailed on each submission (REPLACES the list) |
projectId | string | list_projects id; workspace-wide grants only |
redirectUrl | string | URL to redirect to on success |
submitLabel | string | submit button label (default 'Submit') |
successMessage | string | |
turnstileEnabled | boolean | require a Cloudflare Turnstile check on submit. Omitted on create, it is on only for a site BetterCMS hosts on its *.bettercms.site address (no custom domain, not headless, not your own imported code)… |
update_form Update a form
Update a form by id — name, fields, or settings. Read get_form first. Passing `fields` REPLACES the array (include all fields to keep).
| Parameter | Type | Description |
|---|---|---|
formId * | string | form id (from list_forms) |
branchId | string | content branch id (from list_branches); omit to work on main |
description | string | |
fields | array | REPLACES the field array — include all fields to keep |
honeypotField | name of a hidden honeypot input; a submission that fills it is marked spam. null clears | |
ignored | boolean | true = not one of the site's forms (a search box, a widget); false restores it |
name | string | |
notifyEmails | array | addresses emailed on each submission (REPLACES the list) |
projectId | string | list_projects id; workspace-wide grants only |
redirectUrl | string | URL to redirect to on success |
submitLabel | string | submit button label (default 'Submit') |
successMessage | string | |
turnstileEnabled | boolean | require a Cloudflare Turnstile check on submit. Omitted on create, it is on only for a site BetterCMS hosts on its *.bettercms.site address (no custom domain, not headless, not your own imported code)… |
publish_form Publish a form
Publish a form by id so it accepts submissions. A form create_form made without the publish right is a DRAFT, and a draft form answers every submit with 403 — call this before embedding it with `<BcmsForm form={getForm('Name')} />`. It re-bakes the project's site; `meta.rebuildQueued` says whether a rebuild was actually queued (false for a project with no connected source). 403 PUBLISH_NOT_GRANTED means this connection may author but not publish: say so and let the user publish from the dashboard Forms tab. 404 means the form is not in this connection's project.
| Parameter | Type | Description |
|---|---|---|
formId * | string | form id (from list_forms) |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
get_layout Get the project or page Layout
Read the Global Layout or one page's Layout override, including its optimistic revision. Always read this before update_layout. copy:'published' reads the published copy — the only honest receipt for a publish claim.
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
copy | string | which copy to read; default draft. Verifying a publish MUST read copy:'published' and check the response's copy echo — the draft is never a publish receipt (FLO-1188). |
pageId | string | page id or slug; required for page scope |
projectId | string | required only for a workspace-scoped grant |
scope | string |
update_layout Apply Layout draft commands
Apply permission-shaped values/composition/schema commands to the Global Layout or a page override. Draft-only: this never publishes. Pass the revision from get_layout as ifMatch. ONE command in `command`, or an ordered batch in `commands` (prefer the batch for more than three of anything — placing site chrome is add-section, add-component and set-bindings in sequence): each command is applied against the revision the previous one RETURNED, so you do not re-read get_layout between them. A batch stops at the first failure and tells you how many were applied and the revision it stopped at —…
publish_layout Publish the Global Layout draft
Publish the connected project's GLOBAL Layout draft (navigation, footer, every reserved section). On a site BetterCMS serves, a Layout publish never builds: it writes the VALUES into the live pages, and a STRUCTURE change (Sections added, removed, moved) waits for a Rebuild or a push (`layout-rebuild-required`); a custom host gets its deploy hook. Until published, get_layout copy:'published' answers PUBLISHED_LAYOUT_UNAVAILABLE. Pass get_layout's `revision` as ifMatch; a stale one returns 409 — re-read, never retry blindly. A 422 lists validation issues (global, or per page override: pageSlu…
| Parameter | Type | Description |
|---|---|---|
ifMatch * | integer | revision returned by get_layout (scope global) |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | required only for a workspace-scoped grant |
list_components List reusable components
List the reusable components in the bound project. By DEFAULT this is the catalogue: id, name, slug, category, `sectionType` (the section family — a component with none is not in the editor's 'Add a section' picker), `status` ('draft' renders as NOTHING on the live site), `kitEntry` (the Kit Library entry it follows, null for none), the `group` an editor browses it under, and `usedOn` — `{ pages, paths }`, how many draft pages place it (directly, inside another component, or through the site Layout) and the first few of their paths, so `pages: 0` means no page uses it and you never need ge…
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
detail | boolean | true = every component's full blockJson and props. Costly and rarely what you want — read one definition with get_component instead. |
projectId | string | list_projects id; workspace-wide grants only |
get_component Get a component (with its blockJson)
One component with its blockJson and props (stored `ui` on them; `stale: true` = no placement renders it). Read it before update_component to keep its blocks, and after declaring field UI: a prop absent here was not stored. `variantGroup`: the family of looks it belongs to, if any, and its looks.
| Parameter | Type | Description |
|---|---|---|
componentId * | string | component id (from list_components) |
branchId | string | content branch id (from list_branches); omit to work on main |
detachedCopy | object | {overrides?}: a rich-text embed's separate-copy `fields` (playbook §5) |
projectId | string | list_projects id; workspace-wide grants only |
search_kit Search the Kit Library
Search the Kit Library, the catalogue every new section is built from: `query` words (an id, a name or what it shows: 'mega menu', 'pricing table'), a `category` and a `tag` narrow it. Returns `{ total, entries }`, best first, each `{ id, name, category, tags, proves, uri, from }`. Read one with get_kit_entry, then build it with create_component { from: "kit:<id>" }, or name it as `kitEntry` on a component you write.
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
category | string | one category's slug |
limit | integer | entries to return, 1 to 50 (default 10) |
projectId | string | list_projects id; workspace-wide grants only |
query | string | words of an id, a name or what the section shows |
tag | string | one edge tag (repeater, slots, references, form…) |
get_kit_entry Read one Kit Library entry
One Kit Library entry by id (a guessed bettercms://kit/<id> or kit:<id> resolves): its notes (why, htmlSignals, mcp, pitfalls), `props` as the candidates a section maps onto (key, type, role, a list's item `fields`, a select's `options`), and `component`, the entry's prop definitions with their `ui` and config (no blockJson, no targets, so never a create_component body on its own: `from: "kit:<id>"` builds it). An unknown id is a 404 kit_entry_unknown whose `candidates` are the three nearest entries.
| Parameter | Type | Description |
|---|---|---|
id * | string | an entry id; bettercms://kit/entry/<id>, bettercms://kit/<id> and kit:<id> resolve too |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
create_component Create a reusable component
Create a reusable component from a blockJson tree. THIS IS ALSO HOW A PAGE GETS ITS SECTIONS: set `sectionType` (e.g. 'Hero') and the component becomes a placeable section, selectable in the editor's 'Add a section' picker. Components sharing a `sectionType` are its layout VARIANTS — one Hero with a 'Centered' and a 'Two-column' variant, same prop keys, so a swap keeps the content. CONFIRM the structure with the user first. blockJson is an array of blocks — the same set create_page accepts (heading, text/richtext, image, button, spacer, video, columns, section, slider, tabs, navbar, footer…
publish_components Publish many components in one call
Publish up to 100 components in ONE call — the same act as publish_component, once per item, copying each DRAFT definition to the live copy. Each item reports `{ ok, status, error, readiness }` and a failure never stops the run. 🔴 A 409 COMPONENT_IMPLEMENTATION_NOT_READY is NOT retried: only the owner, in the dashboard, clears it (publish_component says when); relay the item's `readiness` to the user as what only they can approve. 403 PUBLISH_NOT_GRANTED means this connection may author but not publish; 422 means the publish would break a Layout, and the item names which.
| Parameter | Type | Description |
|---|---|---|
componentIds * | array | component ids (from list_components) |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
compose_pages Set many pages' block composition in one call
Give up to 50 pages their block composition in ONE call — the same write as update_page's `blockJson`, once per item, and it REPLACES each page's whole block array. Address a page by `pageId` or by `slug`. Each item reports `{ ok, pageId, slug, error }` and a failure does not stop the run. BEFORE writing anything it reads this project's component catalogue once and REFUSES any item placing a componentId the project does not have — its missing sections would render as empty strings with no error anywhere. Writes DRAFTS: publish each page with update_page status:'published' afterwards. A pag…
| Parameter | Type | Description |
|---|---|---|
pages * | array | |
branchId | string | content branch id (from list_branches); omit to work on main |
dryRun | boolean | validates and reports what would be written; writes nothing |
projectId | string | list_projects id; workspace-wide grants only |
update_component Update a reusable component
Update a component by id — blockJson, props, name, or category. Read with get_component, then pass `ifMatch` = the version from that read. Passing `blockJson`/`props` REPLACES them. Changing a prop's `defaultValue` also rewrites the blockJson slot its `target` names when that slot still holds the old default (placements keep their own values), so do not edit both. This writes the DRAFT: call publish_component to push the change live. Setting or changing `kitEntry` puts that entry's ui over every prop's server-derived ui: the entry wins where it specifies a tab, group, control or preview key,…
set_component_source Record which file implements a component
Call this RIGHT AFTER you write or locate a component's code in the app's repository: it records which file renders it, so the dashboard's Output button can preview and validate it with no setup (without it nothing is validated). Record ONLY a file that renders exactly this component from its own fields: a component whose props are this component's field keys (`kind: 'file'`, the default), or a section the codemod extracted with `npx @bettercms-ai/convert --componentize` — a file starting `// @bettercms-ai/convert section` whose props are `{ blockId, bind, overrides, page }` (`kind: 'section…
| Parameter | Type | Description |
|---|---|---|
componentId * | string | component id (from list_components) |
path * | string | file path relative to the app root, e.g. src/components/sections/Hero.astro |
branchId | string | content branch id (from list_branches); omit to work on main |
export | string | named export that renders it; omit for a default export |
kind | string | 'file' (props are this component's fields; default) or 'section' (a codemod-extracted section: props { blockId, bind, overrides, page }) |
projectId | string | list_projects id; workspace-wide grants only |
get_component_readiness Read a component's Output validation readiness
Read what stands between a component and a validated Output: `validation.gap` and `validation.fix` say why a validation run cannot take it yet (COMPONENT_SOURCE_NOT_RECORDED: record its file with set_component_source, or place it and deploy a build whose markup carries its data-bcms-block / data-bcms-field attributes), and the readiness says where its request, evidence and approval stand. Call it after authoring a component and after every validation run. outputReady means the Output renders; publishReady also needs the owner's Visual Approval in the dashboard, which no tool can give.
| Parameter | Type | Description |
|---|---|---|
componentId * | string | component id (from list_components) |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
publish_component Publish a component
Publish one project-scoped component variant after its exact implementation evidence and human approval are ready: copy its DRAFT definition to the live copy and re-bake every published page that embeds it. This is the ONLY way a component reaches the live site. Built-in `builtin:*` rows are locked blueprints, not implementations; materialize one with create_component first. Workspace-global component publication is currently fail-closed. Drafts (create_component, update_component) render as NOTHING live, with no error: publish every component you place on a page. 403 PUBLISH_NOT_GRANTED means…
| Parameter | Type | Description |
|---|---|---|
componentId * | string | component id (from list_components) |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
write_content Write, rewrite, or translate content
AI-write a piece of copy: action 'write' (draft from a brief), 'rewrite' (improve existing copy), or 'translate' (needs targetLang). Returns the suggested text — apply it with set_page_content or update_content_entry. Uses the workspace's own Anthropic key (BYOK, unmetered) or platform AI credits.
| Parameter | Type | Description |
|---|---|---|
action * | string | 'write' = draft from a brief, 'rewrite' = improve existing copy, 'translate' = needs targetLang |
text * | string | the source text (a brief for 'write', the copy to change otherwise) |
branchId | string | content branch id (from list_branches); omit to work on main |
context | string | optional surrounding context, e.g. the page title |
instructions | string | optional extra guidance, e.g. 'make it punchier' |
projectId | string | list_projects id; workspace-wide grants only |
targetLang | string | required for 'translate', e.g. 'Spanish' |
generate_seo_meta Generate SEO metadata
Generate SEO metadata (metaTitle, metaDescription, keywords, optional JSON-LD) for a piece of content. Pass the page/entry content as `text`. Returns a suggestion: apply a page's with update_page (metaTitle, metaDescription, schemaType, schema) and an entry's with update_content_entry `meta`.
| Parameter | Type | Description |
|---|---|---|
text * | string | the content to derive SEO metadata from |
branchId | string | content branch id (from list_branches); omit to work on main |
context | string | optional surrounding context, e.g. the page slug |
projectId | string | list_projects id; workspace-wide grants only |
create_media_upload Get a presigned media-upload URL
PREFERRED way to add an image — get a presigned URL and upload the file DIRECTLY to storage, so the bytes never pass through the conversation. Flow: (1) call this with filename, mimeType and sizeBytes (the file's exact byte length); (2) PUT the file to `uploadUrl`, e.g. `curl -X PUT -H 'Content-Type: image/jpeg' --data-binary @photo.jpg "<uploadUrl>"` — the url pins both headers, so they must match exactly; (3) call attach_media_upload with the `assetId` + `uploadKey`. URL expires in 10 minutes.
| Parameter | Type | Description |
|---|---|---|
filename * | string | file name incl. extension, e.g. 'hero.png' |
mimeType * | string | MIME type, e.g. 'image/png' |
sizeBytes * | number | the file's exact size in bytes (e.g. from `stat`/`wc -c`) — the presigned url pins it |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
attach_media_upload Attach a presigned media upload
Register a file you already uploaded via create_media_upload (step 3) into the Media Library and get back its CDN url. Pass the `assetId` + `uploadKey` from step 1, plus the filename and any alt text/caption.
| Parameter | Type | Description |
|---|---|---|
assetId * | string | the assetId from create_media_upload |
filename * | string | file name incl. extension |
uploadKey * | string | the uploadKey from create_media_upload, after the PUT succeeded |
altText | string | |
branchId | string | content branch id (from list_branches); omit to work on main |
caption | string | |
folderId | string | |
projectId | string | list_projects id; workspace-wide grants only |
transcript | string | video/audio only: the spoken words (≤ 100,000 chars) |
update_media Update a media asset
Describe an existing media asset: set its alt text, caption, transcript, `decorative` (no alt text needed) or focal point (focalX/focalY, the spot crops keep in frame; delivered images carry it with width, height and thumbHash). Alt text, caption and a transcript (video/audio only, ≤ 100,000 chars) are stored ON the asset and take effect at once on every page and entry using the file — hosted pages, the .md twin, llms-full.txt and the delivery API; there is no draft to publish. `folderId` moves it into a folder (null takes it out); its URL does not change. Pass null to clear a field. Use t…
| Parameter | Type | Description |
|---|---|---|
assetId * | string | media asset id (from list_media / upload_asset) |
altText | alt text; null clears | |
branchId | string | content branch id (from list_branches); omit to work on main |
caption | caption; null clears | |
decorative | boolean | needs no alt text |
focalX | focal point, 0-1 across from the left edge; null resets to the centre | |
focalY | focal point, 0-1 down from the top edge; null resets to the centre | |
folderId | a folder id from list_media_folders; null takes it out of every folder | |
projectId | string | list_projects id; workspace-wide grants only |
transcript | the spoken words; null clears. Video/audio only. |
list_media List media assets
List the project's Media Library (id, url, filename, mimeType, sizeBytes, width, height, altText, caption, transcript, decorative, focalX, focalY, folderId, createdAt). Reuse an asset instead of uploading it again. Filter with `search` (filename, alt, caption), `type` ('image', 'video', ...), `folderId` (from list_media_folders; 'root' = in no folder) and `missingAlt: true` (images that need alt text: write it with write_alt_text, save it with update_media). `sort`: newest (default), oldest, largest, name.
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
folderId | string | a folder id from list_media_folders, or 'root' for assets in no folder |
limit | number | |
missingAlt | boolean | true = only images that need alt text (not decorative, alt text empty) |
page | number | |
projectId | string | list_projects id; workspace-wide grants only |
search | string | |
sort | string | newest (default), oldest, largest or name |
type | string |
get_media Get a media asset
Get one media asset by id — its CDN url, filename, MIME type, size, alt/caption and transcript. Use the url as the value of an 'image' or 'file' field. `references: true` adds `usedOn`: the pages and entries (draft or live) that use it. Read it before delete_media.
| Parameter | Type | Description |
|---|---|---|
assetId * | string | media asset id (from list_media / upload_asset) |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
references | boolean | true = add `usedOn`: the pages and entries that use it |
delete_media Delete a media asset
Delete a media asset from the Media Library (soft delete — reversible from the dashboard trash). Provide assetId. Check get_media references first: deleting an asset in use leaves broken images.
| Parameter | Type | Description |
|---|---|---|
assetId * | string | media asset id (from list_media) |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
delete_form Delete a form
Delete a form by id. Soft delete — the form stops rendering and accepting submissions, but leads already collected against it are preserved (their files are removed). Use it to clean up forms created by mistake.
| Parameter | Type | Description |
|---|---|---|
formId * | string | form id (from list_forms) |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
list_form_submissions List a form's submissions (leads)
List a form's SUBMISSIONS (leads) with their field values. Filter with status ('inbox'|'spam'); paginate with limit/page. A file field gives file names only: no tool returns a file or download link.
| Parameter | Type | Description |
|---|---|---|
formId * | string | |
branchId | string | content branch id (from list_branches); omit to work on main |
limit | number | |
page | number | |
projectId | string | list_projects id; workspace-wide grants only |
status | string |
get_content_structure Get the Content sidebar structure
Returns { doc, version, summary }: `doc` is the raw document ({ schema: 1, folders: [{ id, parentId, name, icon, sort }], items: [{ kind: 'page'|'collection', id, folderId, sort, icon }] }), `version` is what set_content_structure needs, and `summary` is the resolved tree with page and collection TITLES (`outline` is a readable version), ids that no longer resolve (`missing`), and the pages and collections not in any folder yet. Call it before changing the structure; a 403 SCHEMA_ACCESS_REQUIRED on a change means this connection lacks Admin or Developer: stop and tell the user. ORGANISATION ON…
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
suggest_content_structure Propose the standard Content structure
READ-ONLY: propose the standard Content sidebar structure for the connected project (bettercms://playbook/structure) and write NOTHING. Runs the standard over the project's pages, collections, references and built routes: the home page and each collection's list page pinned, one folder per content family named for its detail type (Blog posts, Case studies, Products with its taxonomies and an Attributes subfolder), ordered by entry count (or the caller's nav order), shared taxonomies in Shared, every remaining page in Pages, at most 2 levels deep. Page-bound models are never filed. Returns { do…
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
maxDepth | integer | folder nesting to propose; default 2 (the standard), 4 is the hard limit |
projectId | string | list_projects id; workspace-wide grants only |
set_content_structure Replace the Content sidebar structure
Replace the whole Content sidebar document in one write. Follow the structure standard (read bettercms://playbook/structure first; suggest_content_structure returns a ready doc). Send the complete `doc` and the `version` get_content_structure returned (0 when the project has none yet). Validated exactly like the dashboard: unique folder ids, every parentId/folderId a folder in the doc, no cycles, depth ≤4, names 1-80 chars, kit icons (bettercms://icons/dock). A 412 VERSION_CONFLICT means someone changed it since you read it: read again and re-apply. Returns the new version and a diff. ORGANI…
| Parameter | Type | Description |
|---|---|---|
doc * | object | the complete document |
version * | integer | the version get_content_structure returned |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
create_folder Create a Content sidebar folder
Create a folder in the Content sidebar, at the top level or inside `parentId`, placed after what is already there. Returns the new `folderId`. Reads, applies and writes with the version check, retrying once on a conflict. ORGANISATION ONLY: Content sidebar folders never change a URL, slug, content or publish state, and nothing is rebuilt or delivered; URL folders (page folders) are set in the dashboard. Read the resource bettercms://playbook/structure before you organise anything: it holds the rules this refuses on — system folders, type purity, the Admin/Developer access check, root pins an…
| Parameter | Type | Description |
|---|---|---|
name * | string | the folder's label, 1-80 chars |
branchId | string | content branch id (from list_branches); omit to work on main |
icon | string | optional kit icon name (bettercms://icons/dock), e.g. 'folder' |
parentId | string | optional parent folder id (from get_content_structure); omit it, or send 'root', for the top level |
projectId | string | list_projects id; workspace-wide grants only |
rename_folder Rename a Content sidebar folder
Rename a Content sidebar folder. Sidebar only, never a URL; rules: bettercms://playbook/structure.
| Parameter | Type | Description |
|---|---|---|
folderId * | string | folder id (from get_content_structure) |
name * | string | the new label, 1-80 chars |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
move_to_folder Move into a Content sidebar folder
Move a page, a collection or a folder into a folder. folderId null moves it back to its home: Pages for a page, the Shared list for a collection, the top level for a folder. It lands after what is already there. Moving a folder takes its contents with it and is refused if the result would nest deeper than 4 levels or put a folder inside itself. Sidebar only, never a URL; rules: bettercms://playbook/structure.
| Parameter | Type | Description |
|---|---|---|
folderId * | target folder id; 'root' pins a page or collection at the top level (for a folder, 'root' is the top level); null moves it back to its home (Pages, the Shared list, or the top level for a folder) | |
id * | string | the page id, collection (content model) id, or folder id |
kind * | string | what the id IS on this branch — VERIFIED, not assumed: an id is either a page or a collection, never both, and a mismatch is refused with 400 NAV_KIND_MISMATCH naming the kind to use. Call it again… |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
set_brand_assets Point the brand's logo or favicon at a media asset
Point the brand's logo (mark) or favicon at a media asset of this project — upload it to this project's media library first if it is not there. A slot a PERSON chose is refused without replace: true, and the refusal says so. The brand kit's rules (consume its tokens, never copy values or invent brand facts) are on get_project.
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
favicon | media asset id for the favicon; null clears it | |
mark | media asset id for the logo; null clears it | |
projectId | string | list_projects id; workspace-wide grants only |
replace | boolean | override a slot a person chose (default false) |
set_brand_graphics Add, replace or remove the brand's gradients
Add, replace or remove the brand's gradients — the blobs and washes a site uses as backgrounds. They are TOKENS, not media. A stop naming a colour the kit does not have is refused; add it to `extras` first. Upsert matches BY KEY. The brand kit's rules (consume its tokens, never copy values or invent brand facts) are on get_project.
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
remove | array | gradient keys to remove |
upsert | array | gradients to add or replace, matched BY KEY |
set_icon Set a Content sidebar icon
Set or clear the sidebar icon of a page, a collection or a folder. Sidebar only, never a URL; rules: bettercms://playbook/structure.
| Parameter | Type | Description |
|---|---|---|
icon * | kit icon name (bettercms://icons/dock), e.g. 'document-text'; null clears it | |
id * | string | the page id, collection (content model) id, or folder id |
kind * | string | what the id IS on this branch — VERIFIED, not assumed: an id is either a page or a collection, never both, and a mismatch is refused with 400 NAV_KIND_MISMATCH naming the kind to use. Call it again… |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
delete_folder Delete a folder (its contents move up; nothing is deleted)
Delete a folder (its contents move up; nothing is deleted). NOTHING ELSE IS DELETED: its pages, collections and sub-folders move up to the folder's parent, in the same order. Sidebar only, never a URL; rules: bettercms://playbook/structure.
| Parameter | Type | Description |
|---|---|---|
folderId * | string | folder id (from get_content_structure) |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
list_redirects List redirects
List the URL redirects configured for the connected project (source path → destination, type).
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
update_redirect Update a redirect
Update an existing redirect in place — change where it points, its HTTP status, or disable it without deleting. Prefer this over delete+create: it keeps the redirect's id and preserves the chain-collapse rewrites of other rules pointing at it. Only provided fields change. Loops 422, duplicate sources 409.
| Parameter | Type | Description |
|---|---|---|
redirectId * | string | redirect id (from list_redirects) |
branchId | string | content branch id (from list_branches); omit to work on main |
destination | string | |
isActive | boolean | set false to disable without deleting |
projectId | string | list_projects id; workspace-wide grants only |
redirectType | string | HTTP status; 410 = Gone |
sourcePath | string |
create_redirect Create a redirect
Create a URL redirect — e.g. a 301 after renaming a page's slug. `sourcePath` is the path to redirect FROM ('/old-page'), `destination` the path/url TO ('/new-page'). Chains collapse; loops/dupes rejected. Defaults to 301.
| Parameter | Type | Description |
|---|---|---|
sourcePath * | string | |
branchId | string | content branch id (from list_branches); omit to work on main |
destination | string | |
dryRun | boolean | true = return the verdict, write nothing |
projectId | string | list_projects id; workspace-wide grants only |
redirectType | string | default '301'; 410 = Gone, omit destination |
delete_redirect Delete a redirect
Delete a URL redirect by id (from list_redirects). Provide redirectId.
| Parameter | Type | Description |
|---|---|---|
redirectId * | string | |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
get_seo Get site SEO
Get the connected project's site-wide SEO settings — every key update_seo writes: seoDefaults (metaTitle, metaDescription, ogImage, twitterHandle, og, twitter, collectionSchemaTypes), siteSchema (the site's JSON-LD), robotsConfig, sitemapConfig, rssConfig, indexnowConfig and searchConfig.
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
update_seo Update site SEO
Set the connected project's site-wide SEO defaults and config. Each key you send is REPLACED whole (not deep-merged), so read get_seo and send the complete object. `seoDefaults` applies to every page that does not override it, and its `collectionSchemaTypes` maps a collection's model id to the schema.org type of its entries. `siteSchema` is the site's own JSON-LD (Organization/WebSite, emitted on the home page). `robotsConfig`, `sitemapConfig` and `rssConfig` shape robots.txt, sitemap.xml and the feed; `indexnowConfig` pings search engines on publish; `searchConfig` is site search. A key the p…
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
indexnowConfig | object | IndexNow on publish, minus URL patterns to leave out |
projectId | string | list_projects id; workspace-wide grants only |
robotsConfig | object | robots.txt: 'auto' (`disallow` names AI crawlers to block), or 'custom' with its text |
rssConfig | object | the RSS feed on or off |
searchConfig | object | site search: on/off, the box's placeholder, AI answers |
seoDefaults | object | site-wide meta defaults every page inherits |
siteSchema | the site's JSON-LD: an object or an array of objects | |
sitemapConfig | object | sitemap.xml: generated ('auto') or 'custom', defaults and extra URLs |
get_site_files List site files
List the AI-crawler files installed on the connected project (llms.txt / llms-full.txt) — metadata only.
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
set_site_file Set a site file
Create or replace an AI-crawler file served at the site root — `kind` 'llms.txt' or 'llms-full.txt' — with `content` (plain text, max 5 MB). Rebuilds the site.
| Parameter | Type | Description |
|---|---|---|
content * | string | |
kind * | string | |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
delete_site_file Delete a site file
Remove an AI-crawler file (llms.txt / llms-full.txt) from the connected project. Provide kind.
| Parameter | Type | Description |
|---|---|---|
kind * | string | |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
get_project Get the connected project
Get the connected project's info — id, name, slug, subdomain, and its live URL (https://<handle>.bettercms.site). Use it to tell the user where their site is published / link the result. It also returns `mediaBaseUrl` — the CDN origin this project's media is minted and resized on. A deployed site's `PUBLIC_BCMS_MEDIA_URL` / `mediaUrl` must equal `mediaBaseUrl`, or resized images 404 on any rung but production. `urls` are where a person opens it: `live`, `dashboard` and the visual `editor`. `allowedOrigins`: the browser origins that may read this site's content with its key; empty means any…
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
list_projects List projects
List the projects this key can see — id, name, slug, and live URL each. A project-scoped key sees only its own project; a workspace-level key sees every project in the workspace. Use it to find a project you created earlier, or to confirm which sites exist before acting.
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
update_project Update the connected project
Update the connected project's settings — rename it, change its slug/description, SEO defaults, visibility, or `presentation`. Only the provided fields change. `subdomainAlias` renames the staging URL: 'astronapp' serves the site at astronapp.bettercms.site (3–55 lowercase letters, numbers, hyphens; 409 when taken; null goes back to the original). The original <handle>.bettercms.site keeps working; a replaced name is released. `presentation` themes the platform's OWN renderer (the one serving a site built in the CMS with no deployed build, and previewing structural drafts everywhere) with…
| Parameter | Type | Description |
|---|---|---|
allowedOrigins | array | browser origins (https://host[:port], or https://*.example.com for its subdomains) allowed to read this site's content with its key; REPLACES the list; [] = any origin. Read the current list from get_… |
branchId | string | content branch id (from list_branches); omit to work on main |
description | string | |
name | string | |
presentation | object | theme knobs for the platform renderer, keyed like bcms-presentation.json |
projectId | string | list_projects id; workspace-wide grants only |
seoDefaults | object | |
slug | string | |
structureInPlace | boolean | true: in-place structure on (the gate fix enable-in-place-structure); never off |
subdomainAlias | string | null | the staging name: 'astronapp' → astronapp.bettercms.site; null = back to the original |
visibility | string |
create_project Create a new project
Create a NEW project (site) in the connected workspace. ASK THE USER WHICH TECHNOLOGY TO BUILD WITH FIRST and pass it as `framework` — 'astro' (recommended default), 'next', 'react-ts' (React + TypeScript), 'sveltekit', 'nuxt', or 'other' for a headless project with no generated frontend. Do not pick for them: called without it, this tool asks them directly (or hands you the question to ask). Sites cannot be created as plain HTML/CSS — every project is backed by one of these starters, which is what makes its content editable in the CMS. Optionally pass templateId to seed curated content. R…
| Parameter | Type | Description |
|---|---|---|
name * | string | |
branchId | string | content branch id (from list_branches); omit to work on main |
description | string | |
framework | string | REQUIRED in effect — the technology the USER chose. Ask them; never default it. |
projectId | string | list_projects id; workspace-wide grants only |
slug | string | |
templateId | string |
create_delivery_key Create a read-only delivery key for the front end
Create a read-only delivery key for this project's own front end and return it once (it is never shown again: write it straight into the front end's .env under the name its SDK config reads, e.g. BCMS_API_KEY or BETTERCMS_API_KEY, never into chat or a commit). Published content needs no key (the SDK reads it by BCMS_PROJECT_ID), so create one only when the front end's config asks for a key. `scope: "published"` = content:read, no expiry; `scope: "draft"` also reads drafts and expires within the hour (a preview build's credential; editors' previews use the dashboard's preview link instead). Lis…
| Parameter | Type | Description |
|---|---|---|
name * | string | what it is for, shown in the key list (e.g. 'Front end (Vercel)') |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
scope | string | published (content:read, the default) or draft (also drafts; expires within the hour) |
set_front_end Record where the project's own front end lives
Record where this project's own front end lives, so editors open drafts on it ("Preview on site") and a publish reaches it: `siteUrl` (its deployed origin), `framework` (next or astro: which preview route the SDK mounts), `draftPath` (Next only, when not /api/draft) and `revalidation` (a front end that revalidates instead of rebuilding). Call it after the front end is deployed; `npx @bettercms-ai/cli@latest deploy --to <host>` already registers the rebuild hook. Read the current values from get_project. Fields you omit are left as they are; null clears one. Requires artifact:write.
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
draftPath | string | null | Next only: the draft-mode route when not /api/draft (null clears it) |
framework | string | next, astro, react-ts, sveltekit or nuxt: picks the draft route (astro: /api/bcms/draft/enable; the rest: draftPath or /api/draft) |
projectId | string | list_projects id; workspace-wide grants only |
revalidation | a front end that revalidates instead of rebuilding: { webhookUrl (https), webhookSecret (16+ chars, also stored as BCMS_REVALIDATE_SECRET on the front end) } (null clears it) | |
siteUrl | string | null | the deployed front end's origin, https://… (null clears it) |
set_binding_mode Set how the site's bindings are resolved
Switch this project between the two binding resolvers, from the NEXT release on. `declaredBindings: true` makes the annotator trust the template's own data-bcms-field / data-bcms-props and never guess from rendered text — the durable state; `false` returns to text-matching, which holds only while the CMS values equal the built copy. Call it ONLY after every page's copy is declared in the template: undeclared fields stop being editable. The order around the flip (push, release, clean get_binding_report, flip, release, confirm): skill bindings. Flipping back is the same call. `locator: 'stega'…
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
declaredBindings | boolean | true = trust the template's declared bindings; false = text-match (the default) |
locator | string | 'stega' = locate copy by the build's stega frames (needs a parity proof); 'auto' = off |
projectId | string | list_projects id; workspace-wide grants only |
submit_conversion_receipt Record what the conversion codemod could and could not do
Hand BetterCMS the codemod's own account of a run, so the meter can say WHY a path is undeclared. Submit the receipt `npx @bettercms-ai/convert --receipt out.json` wrote as `{ briefDigest, receipt }`, for the SAME `briefDigest` get_conversion_brief { complete: true } returned (its shape: see `receipt`). 🔴 A RECEIPT WITH PENDING PATHS IS A PROGRESS REPORT, NOT A FINISH LINE: the response answers `complete` and `pendingTotal`, and echoes the first 40 pending rows with their `fix` (`action` one of `wrap-span`, `declare-attr`, `bind-expression`, `declare-richtext`, `bind-data`, `manual`; the ro…
| Parameter | Type | Description |
|---|---|---|
briefDigest * | string | The `briefDigest` get_conversion_brief { complete: true } returned. Must match the receipt's own. |
receipt * | object | The receipt `npx @bettercms-ai/convert --receipt out.json` wrote, verbatim: `paths: { declared, rewritten, alreadyDeclared, pending[{ route, scope, path, kind, file, reason, message, fix }] }` plus `s… |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
list_content_models List content models
List the content models (reusable schemas for dynamic collections like Blog/Products) in the connected project. A project-scoped connection sees its own project's models plus workspace-level ones, which it can read but not change.
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
get_content_model Get a content model
Get one content model by id INCLUDING its full field schema (keys, types, nested group/repeater children) AND each field's stored authoring props — `helpText`, `showIf`, `ui`. Read it before add_field so you know the existing keys, and AFTER declaring `ui`/`showIf`/`helpText` as the receipt that the declaration actually landed: a prop that is missing from this response was not stored, whatever the write returned. Its `optimisticVersion` is the ifMatch for update_content_model.
| Parameter | Type | Description |
|---|---|---|
modelId * | string | |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
update_content_model Update a content model's metadata
Edit a content model: rename it, change description/slug/urlPattern, set its `fieldsets`, or reshape how its EXISTING fields look in the editor. Never adds or retypes a field (use add_field). It removes one only with `removeFields` plus `allowFieldRemoval: true`, which DISCARDS its data in every entry and has no dry run; a page's fields go through remove_page_fields. Send modelId, or pageId for the model a page's schema lives in. `fieldsets` REPLACES the list (null drops all); a field joins one with fieldFieldset or add_field's `fieldsetId`. The field* args address fields by dotted key path ('…
| Parameter | Type | Description |
|---|---|---|
allowFieldRemoval | boolean | true = the user accepts that removeFields discards those fields' data in every entry. There is no dry run on this route: confirm first. |
branchId | string | content branch id (from list_branches); omit to work on main |
confirmed | boolean | true only after the user explicitly approved adding this custom input (`ui.input`), or a hide/fold/required→optional (else a named 409). Removing one needs no approval |
description | string | |
fieldFieldset | object | path → fieldset id, null takes it out |
fieldHelpText | object | path → one-line help; null = none, never refilled |
fieldLabel | object | path or "<family>#section" → label |
fieldOrder | object | the full new order of one parent's child keys (top level without parentPath). An array with both zones needs 'KEY.zones.nonRepeatable' or 'KEY.zones.repeatable'; its bare key is a 400 |
fieldUi | object | path → ui patch, a field's `ui` vocabulary: each key merges, a null key clears it, null clears the whole ui |
fieldsets | ||
ifMatch | integer | optimisticVersion from get_content_model (with pageId: get_page backingModel). The write applies only at that version; a 409 version-conflict means it changed since: read it again and re-apply, never… |
modelId | string | content model id (from list_content_models); or send pageId |
name | string | |
override | boolean | replace chrome a person set (otherwise 409 ui_human_owned names those paths). Send it only on the user's word. |
pageId | string | instead of modelId: the page whose schema model to edit; ifMatch is get_page backingModel.optimisticVersion |
projectId | string | list_projects id; workspace-wide grants only |
removeFields | array | top-level field keys (from get_content_model) to DELETE from this model with every entry's value for them; needs allowFieldRemoval: true. An unknown key refuses the whole call. Never for a rename: ren… |
slug | string | |
urlPattern | string | null | the public URL of one entry, e.g. '/blog/:slug'. Must start with '/' and contain ':slug' exactly once ('{slug}' is refused). Drives RSS item links and the automatic 301 when an entry's slug changes. n… |
v2 | the V2 block {shape?, placement?, category?, variants?: {slug: {icon?, description?}}}; null clears it |
get_content_types Get generated TypeScript types
Get the auto-generated TypeScript types for the connected project's content models/pages. Pull these to write correctly-typed code against the BetterCMS delivery SDK in the user's site.
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
update_page Edit a page
Edit a page: title, slug, SEO metaTitle/metaDescription, structured data (`schemaType`, `schema`), publish status (draft|published), and `blockJson` (its block composition — passing an array REPLACES the whole array, so read get_page first and send its `optimisticVersion` as `ifMatch`; an object adds or styles ONE section). An answer that starts with `held` is a draft the live page will NOT show until each of `holds` has its `action` taken, and a publish answers with `outcome`: `partial` lists the values not live. Never report either as done (skill publishing). `warnings`: COMPONENT_SWAP_DRO…
pull_project_source Pull the project's live source
Get the connected project's CURRENT live source/build so you can edit it locally. Returns a presigned tarball download url (1h) + the live commit sha — download it, extract, edit the files, then call deploy_project. If the project is connected to a GitHub repo, `github` carries owner, repo, branch and cloneUrl — clone it and work on THAT branch, because it is the one the provisioned Action builds from; a commit on any other branch never reaches the live site. On a workspace-wide connection pass `projectId` (from list_projects) to say which site's source to pull.
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
deploy_project Deploy new source/build
Deploy new source/build for the connected project and make it live at its <handle>.bettercms.site. Pass a .tgz or .zip of the project as a base64 string in `data`, or the `uploadKey` of an archive you PUT through create_deploy_upload (no size ceiling: use it for anything large, or after a 413/502). SOURCE (has package.json) is built server-side in an isolated sandbox; a prebuilt static site is served as-is. The upload is imported like a GitHub repo: its bcms-content.json, or else its content collections, seed the CMS (`seeded` in the result). For a folder on the user's machine, prefer `npx @be…
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
data | string | base64 .tgz/.zip of the project; or send uploadKey |
mimeType | string | |
projectId | string | list_projects id; workspace-wide grants only |
uploadKey | string | instead of data: the uploadKey from create_deploy_upload, after PUTting the archive to its uploadUrl |
list_github_repos List importable GitHub repositories
Every GitHub repository this workspace's connected GitHub App installations can reach, grouped by account. Use it to find the repository to import: each ACCOUNT carries the `installationId` that import_github_repo and fork_github_repo take, and each repository under it carries `owner`, `repo` and `defaultBranch`. An empty `accounts` list means nobody has connected GitHub to this workspace yet — tell the user to connect it from the dashboard (Project → Hosting → Connect GitHub) and call this again.
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
import_github_repo Import a GitHub repository
Connect an existing GitHub repository to the connected project (the dashboard's Import from GitHub) — do it BEFORE writing any code for a user who already has a repo. It wires the project API key and variables into the repository, records the connection, assigns the site handle, imports the repo's bcms-content.json as content models when it has one, and queues the first build. Pass `installationId`, `owner` and `repo` from list_github_repos; `branch` defaults to the repository's own default branch and becomes the branch every deploy builds from. It only works on a repository this workspace's…
| Parameter | Type | Description |
|---|---|---|
installationId * | integer | from list_github_repos |
owner * | string | the repository's account, e.g. 'acme' |
repo * | string | the repository name, e.g. 'website' |
branch | string | branch to build from; defaults to the repository's own default branch |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
fork_github_repo Fork a repository and import it
Fork ANY GitHub repository into the user's own account and import it in one step — how a user starts from a repository that is not theirs (a public starter, a template, another account's site). BetterCMS cannot wire a repository it has no installation on, so the copy has to live on their account first; this makes that copy, keeps the upstream link, and then connects it exactly as import_github_repo does. `installationId` names the DESTINATION account (from list_github_repos); `owner` and `repo` name the SOURCE, anywhere on GitHub. `name` renames the fork; `connect: false` forks without conne…
| Parameter | Type | Description |
|---|---|---|
installationId * | integer | the DESTINATION account's installation, from list_github_repos |
owner * | string | the SOURCE repository's account, anywhere on GitHub |
repo * | string | the SOURCE repository name |
branchId | string | content branch id (from list_branches); omit to work on main |
connect | boolean | connect the fork to this project (the default); false forks only |
name | string | name for the fork; defaults to the source repository's name |
projectId | string | list_projects id; workspace-wide grants only |
list_github_branches List the repository's branches
The connected repository's branches, plus `buildBranch` — the one the provisioned Action builds from. A commit on any other branch never reaches the live site, so check this before you push.
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
list_github_commits List the repository's commits
The connected repository's commit history, newest first: sha, message, author, date and url. Defaults to the build branch; pass `branch` for another, `path` to narrow it to one file or directory, and `limit` (1-100, default 20). Read the head sha here before a push you want to be safe, and hand it back as push_to_github's `expectedHeadSha`.
| Parameter | Type | Description |
|---|---|---|
branch | string | defaults to the build branch |
branchId | string | content branch id (from list_branches); omit to work on main |
limit | integer | |
path | string | only commits touching this file or directory |
projectId | string | list_projects id; workspace-wide grants only |
push_to_github Push a commit to the repository
Commit files to the connected repository — a real git commit written server-side by the GitHub App: no clone, remote or token of your own. Send `files` ([{path, content, encoding}]) and/or `deletePaths`, plus a `message`; both go into ONE commit, so a rename is atomic. It targets the BUILD branch by default, where the push starts the rebuild that goes live — poll get_deploy_status after it, and read the response's `note`, which says whether this push deploys. Pass `branch` to push somewhere else (a branch that does not exist yet is created from the build branch, or from `baseBranch`) and t…
| Parameter | Type | Description |
|---|---|---|
message * | string | the commit message |
baseBranch | string | what a newly created `branch` starts from; defaults to the build branch |
branch | string | defaults to the build branch; a branch that does not exist is created |
branchId | string | content branch id (from list_branches); omit to work on main |
deletePaths | array | paths to remove in the same commit |
expectedHeadSha | string | the head you built this change on; the push is refused if the branch moved since |
files | array | files to write or overwrite |
projectId | string | list_projects id; workspace-wide grants only |
create_github_pull_request Open a pull request
Open a pull request on the connected repository. `head` is the branch you pushed; `base` defaults to the build branch, so merging it is what ships the change. Use this instead of pushing straight to the build branch whenever a human should review first, or when that branch is protected. Returns the number and the url to hand the user.
| Parameter | Type | Description |
|---|---|---|
head * | string | the branch you pushed |
title * | string | |
base | string | defaults to the build branch |
body | string | |
branchId | string | content branch id (from list_branches); omit to work on main |
draft | boolean | |
projectId | string | list_projects id; workspace-wide grants only |
list_github_pull_requests List pull requests
Pull requests on the connected repository: number, title, state, whether it merged, draft, head, base and url. `state` is 'open' (the default), 'closed' or 'all'. Poll it to find out whether the pull request you opened has landed.
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
limit | integer | |
projectId | string | list_projects id; workspace-wide grants only |
state | string |
pin_element Make one element of a page a field
Make one element of a page a field, flipping a derive's judgment you disagree with (an SVG_AFFORDANCE glyph kept out of the fields, any element it declined). `locator` exactly as rederive_page's `preview.notEditable[]` gives it. Every later derive keeps the field. Refusals (`code`): no-element, ambiguous, already-pinned, layout-owned, not-singleton, bindings-declared, no-html, version-conflict.
| Parameter | Type | Description |
|---|---|---|
locator * | object | as rederive_page's preview.notEditable[].locator |
pageId * | string | page id or path ('/de/about'); a bare slug only when one page has it |
branchId | string | content branch id (from list_branches); omit to work on main |
ifMatch | integer | the page's optimisticVersion |
projectId | string | list_projects id; workspace-wide grants only |
write_fields Write field values by field ref
Write field values by field ref: 1 to 50 writes on ONE document, all landing or none. `fieldPath` is `<target>:<id>:<path>`: entry:<entryId>:hero.title, page:<pageId>:hero.title (a page's own field), page:<pageId>:<blockId>__overrides.<prop> (a placed component's copy on that page), page:<pageId>:<blockId>__<prop> (a built-in block's prop), layout:<sectionId>:<fieldId> (site chrome) or component:<componentId>:<prop> (a definition's default, on every page that places it: needs schema authority). The path is patch_content_entries' (dots, a row by [_key=="k"] or [n]); a data-bcms-field stamp on p…
| Parameter | Type | Description |
|---|---|---|
writes * | array | [{fieldPath, value} or {fieldPath, op, …}], 1 to 50, every fieldPath on one document |
branchId | string | content branch id (from list_branches); omit to work on main |
dryRun | boolean | validates and reports what would be written; writes nothing |
ifMatch | integer | the document's version (get_field_paths meta.version, or a get's optimisticVersion); a page's own fields take its entry's optimisticVersion, a version_conflict's currentVersion |
projectId | string | list_projects id; workspace-wide grants only |
get_field_paths List what a document can be written at
What a document can be written at: one row per writable value, {fieldPath, type, kind, required?, options?, min?, max?, maxLength?, pattern?, shape?, locked?, current?}, each `fieldPath` ready for write_fields, and `meta.version` for its ifMatch (on a page, its sections' version: a page's own fields take its entry's, see write_fields). Pass `document` (entry:<id>, page:<id>, layout:<sectionId>, component:<id>), or `pageId` / `entryId`. A page lists its own fields and each placed component's declared props.
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
document | string | entry:<id>, page:<id>, layout:<sectionId> or component:<id> |
entryId | string | |
pageId | string | |
projectId | string | list_projects id; workspace-wide grants only |
get_next_steps Get what to do next
Call this FIRST on a project. Returns `receipt` — `done` (live release, bound elements, conversion coverage, composed pages, published components and Layout), `missing`, `nextAction` and `notes` (unjudged: unknown, not done) — plus `data`, the unfinished items by `ruleId`. Each item cites its count and may carry `payload` {rows, total}. Compact by default: each list its first 5 rows beside its total (`full` lists all). `receipt.complete` is the setup gate's verdict and `receipt.gate` its numbers per built route. `check` (a comma list) keeps only those checks' gate rows. Run `receipt.gate.n…
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
check | string | only these gate checks' rows, a comma list: page, published, twin, text, image, link, sections, style, svg, number, attribute, names (or naming), seo, structuredData, collections, buttons, components,… |
full | boolean | true = every list uncut (default: 5 rows a list beside its total, 25 routes a next action) |
importJunk | boolean | true = add rule import-junk: what an old import left, with removal calls |
projectId | string | list_projects id; workspace-wide grants only |
get_binding_report Check what on the live site is editable
The receipt for 'is this site actually EDITABLE?'. Each release scans the built HTML for the element rendering each CMS field value; per slot this returns `mode` ('text-match' = guessed from rendered text, 'declared' = template-declared), `locator` (how the NEXT release locates copy: 'stega' or 'auto', set_binding_mode), what was bound, and `unmatched`: each path with its reason (reasons: skill bindings). DEPLOY FIRST: before any release there is no report (pages 0, mode null, refreshRequired true). `refreshReason`: a HEADLESS site never gets one (`never-generated`); `layoutRoutes` and `covera…
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
route | string | one built route, e.g. /about: every by-route list holds its rows only |
slot | string | which release tree to read — everything here, `unaddressable` included, is measured PER SLOT, so on a promote-gated project pass 'current' to read the tree the editor frames. Defaults to the slot th… |
get_conversion_brief Get the brief for making this site's bindings durable
The per-project brief for making this site's bindings DURABLE — read it before you touch the templates. Returns what already exists in the CMS: every live page with its route, every bindable field path with its `label`, `kind`, the CMS value (`current`) and the copy the repo renders today (`original`), the exact attributes to declare, and the ordered steps. Call it for any site whose pages were DERIVED at import, and whenever get_next_steps reports `bindings-not-declared`. It REPLACES re-registering a schema: these pages, fields and values exist already, so create_page / add_field / create_c…
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
complete | boolean | true = the COMPLETE brief for a codemod: nothing truncated, no page omitted, paged 50 pages at a time. Page 1 pins the path list the coverage meter measures against. |
cursor | string | The `cursor` from the previous page. Implies complete. A 409 BRIEF_CHANGED means the brief was re-derived mid-pagination — start again with no cursor. |
projectId | string | list_projects id; workspace-wide grants only |
responseCursor | string | A cut list's `_budget` responseCursor: its next page, same arguments |
get_conversion_plan Get the approved conversion to apply
The APPROVED conversion a human reviewed in the BetterCMS dashboard: the exact new contents of each template file, already checked against this project's real field paths. Apply it instead of writing the bindings by hand. Check out `baseHeadOid` (the exact commit it was written against), branch from there, write each file's `content` verbatim (whole file, no merge, no reformatting), then push or deploy however this project ships. `stale.head` / `stale.brief` say the repository or the CMS moved since it was approved: stop and ask for a fresh proposal. `receipt.paths.pending` lists every field t…
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
get_site_composition Check every page is assembled from registered components
The receipt for 'is every page assembled from registered components?' — read-only, computed live. Call it before a whole-site componentize run (playbook §12) and after it, as the proof. Per page: `kind`, a block census, `nonComponentBlocks` and every `component` placement with its `status` (a draft renders as an EMPTY STRING on the live site), `inPicker` and `emptyRequiredProps`. Site-wide: counts, `awaitingApproval` (a HUMAN approves in the dashboard; no tool here can), `notInPicker`, `unused` and `layout.placements`. Each field: skill components. `verdict.everyPageComposed` with `verdict.…
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
get_componentize_plan Get the plan for turning this site's sections into components
What this site's SECTIONS would become as components — a proposal that creates nothing and is computed live. For a site whose pages were DERIVED at import, each top-level field GROUP is one section: `hero-*` and `faq-*` keys, and the repeaters the import folded (`group-*`). Per page: each section's `groupKey`, `sectionType` family, leaf `fields` with their CMS values, `shapeHash`, and either the component already rendering it (`reuse.componentId`) or the proposed one (`reuse.proposedSlug`). Under `components`, a NEW one carries the exact `props` and `blockJson` create_component would take; a…
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
cursor | string | The `cursor` from the previous page. Implies paged. A 409 `PLAN_CHANGED` means start again with no cursor. |
paged | boolean | true = 10 pages at a time; the response carries `page`, `pageCount` and a `cursor` for the next. |
projectId | string | list_projects id; workspace-wide grants only |
summary | boolean | true = no values: each section's groupKey, family, pending and component slug. Read this first. `pending` codes (each explained in skill componentize): `NO_GROUP_ROOT`, `NOT_A_SECTION` (`detail`: `ENT… |
componentize_sections Turn this site's derived sections into components
Turn this site's derived sections into components. CONFIRM WITH THE USER FIRST: show them get_componentize_plan's sections, how many components it will create and which pages it will rewrite; `dryRun` first. It creates each proposed component as a DRAFT and replaces each page's DRAFT blocks with ordered `component` instances, one per group. The page keeps its `fields`, values and bindings (see `copy`). Pass the plan's `digest`; a 409 `stale-plan` means the site changed: read the plan again, show the user what changed and confirm again. Read `components.wouldDuplicate` first (skill components).…
| Parameter | Type | Description |
|---|---|---|
digest * | string | The `digest` get_componentize_plan returned. A different one is refused with 409 stale-plan. |
branchId | string | content branch id (from list_branches); omit to work on main |
codemod | boolean | true = componentize nothing; run the section-order codemod in the connected repo on its own Actions, which commits for the next build. After the components and pages are published. `skipped` = no repo… |
copy | string | Who owns each section's copy. 'bind' (default) leaves it in the page fields. 'instance' moves it onto each placement; the page's fields are KEPT and marked `origin: "componentized"` (skill componentiz… |
decline | boolean | true = record `sections` as NOT sections (nothing is componentized; the plan stops proposing them). false = offer them again. Needs `sections`. |
dryRun | boolean | true = return the receipt without writing anything. Do this first. |
group | string | File the components this run creates into this Component Group (by NAME, created when missing), else its section family (skill componentize). A reused component keeps its Group; the receipt's `compone… |
joinTwins | boolean | true = move each locale copy (`/fr`) still on its own component onto its twin's (`bindPaths` keeps its fields). A dry run lists each in `joins`. Whole plan only. |
pageIds | array | Componentize only these pages (ids from the plan). Omit for every page the plan lists. |
pages | array | The same page filter under the name the dashboard uses. Unioned with pageIds; an EMPTY list is refused rather than treated as every page. |
projectId | string | list_projects id; workspace-wide grants only |
sections | array | Act only on these section groupKeys (from the plan); every other section keeps its placement. |
list_seo_issues List SEO issues
Scan every published page for SEO problems (missing or over-long titles and descriptions, missing OG image, noindex, invalid pasted schema) and return them with severities. Also reports accessibility issues as `a11y.*` codes with block ids. Computed live — nothing is stored.
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
get_deploy_status Get deploy/build status
Get the connected project's deploy/build status: state (idle|queued|building|failed), whether it's publishing, the live commit sha, when it went live, and any build error. `editorSetup`: whether editing is set up for the live build (never or stale = call editor_setup). Poll this after deploy_project until state is idle with your sha live. `release`, `held` and `publishes` (`live` or `partial`; a failed one has `error` {code, message}; a `*` row's `detail` names each value that differs, {address, expected, shown}): skill publishing. `runtime` ({state: ok|crash-loop, restarts, oomKilled}) appear…
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
waitSeconds | number | wait up to N seconds (max 45) for it to finish; call again while it runs. In code mode one execute run's waits total under ~80 s: one wait a run |
rebuild_project Rebuild the site
Rebuild, as the dashboard's Rebuild does: the connected repository, or an upload's stored source again with what is published (queued behind a release already under way). Use it when a get_next_steps fix names it, or after a push that started no build; then get_deploy_status { waitSeconds: 45 } until live, and editor_setup. 409 NOT_QUEUED: nothing live and no repository (deploy_project the working tree), or publishing held. 409 qa_blocked: the QA & Safety scan found critical issues. Read `summary` and every finding's title, detail, location and fix. A finding in the repository or the content:…
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
force | boolean | true skips the QA & Safety gate (the override is audit-logged). Only on the owner's explicit word after they have seen the qa_blocked findings; never on your own. |
projectId | string | list_projects id; workspace-wide grants only |
editor_setup Set up editing for the live build
Make the live build editable (skill bindings): after an import or rebuild, before the brief. First time: 409 SCOPE_REQUIRED carries `question` and `defaultScope`: ask the user once, full site or only the pages they choose; on partial, ask them to list the pages to make fully editable (`defaultScope.routes` is the suggestion), then send `scope` with exactly those; stored, never asked again. `ready` if run for the live sha, else starts (`running`; poll `check: true`). `state`: never|stale (run it), running, resuming (died; goes on by itself from `setup.resumesFrom`: poll, never force), ready, fa…
list_env_vars List environment variables
The project's environment variables by NAME and scope (never a value), and `missing`: the ones the repository's .env.example declares that the project does not set. A site missing them builds and serves, then renders empty or crashes in the browser. Resolve `missing` by running `npx @bettercms-ai/cli@latest env push` in the repository: it uploads those values from the user's own .env files straight to BetterCMS, so they never pass through this conversation. Never read, print or ask the user to paste a value. When the values do not exist locally because the site reads its content from another C…
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
create_component_from_kit Create Kit Library entries as components
Create up to 50 Kit Library entries (bettercms://kit) as DRAFT components in ONE call, each built by the server (create_component from:'kit:<id>'): the entry's props, dock ui and targets, `kitEntry` set, filed as a kit fixture (sectionType 'Kit <name>', group 'Kit fixture', slug 'kit-<id>') outside the site's own families. An entry the project already holds is reused. Each item reports `{ ok, componentId, created|reused, sample: { keys, skipped }, error }`; a failure does not stop the run. `placeOn` inserts every item on that page's draft in ONE write, with the entry's sample as overrides (slo…
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
dryRun | boolean | write nothing; say what each item would do |
group | string | folder name; default 'Kit fixture' |
kitEntries | array | Kit Library entry ids, 1 to 50 |
kitEntry | string | one entry id, instead of kitEntries |
name | string | single entry only |
placeOn | object | { pageId, index? }: index defaults to the end |
projectId | string | only needed for a workspace-wide key |
references | object | { col_people: 'team' }: a kit placeholder's collection (slug or id) for references[].unbound |
refresh | boolean | rebuild a held row of the entry in place from the current kit; same id and prop keys, draft only |
sectionType | string | single entry only; default 'Kit <name>' |
list_extraction_candidates Find sections that repeat across pages
Find sections that appear IDENTICALLY (same structure and styling, different wording) on 3+ places across this project's pages, each proposed as one reusable component. Read-only — nothing changes. Returns a `hash` per candidate to pass to extract_component, plus how many places it appears, which fields differ between copies, and the exact pages involved. Use this before hand-building a component with create_component: if a section already repeats, extracting it is better than adding a 4th copy.
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | only needed for a workspace-wide key |
extract_component Extract a repeated section into one component
Fold one candidate from list_extraction_candidates into a single reusable component and repoint EVERY occurrence at it. CONFIRM WITH THE USER FIRST — this rewrites blocks on several pages at once, and name the pages from the candidate's `sites` when you ask. Only page DRAFTS change: the live site is untouched until those pages are published, and the component itself lands as a DRAFT. Fields that differ between copies become component props, so each page keeps its own wording. 409 means the sections were edited since you listed them — re-run list_extraction_candidates and ask again.
| Parameter | Type | Description |
|---|---|---|
hash * | string | candidate hash from list_extraction_candidates |
name * | string | name for the new component |
slug * | string | url-safe unique slug (lowercase letters/numbers/hyphens) |
branchId | string | content branch id (from list_branches); omit to work on main |
category | string | the library category it is filed under (hero, features, cta, …); a connected agent may not leave it 'custom' |
kitEntry | string | the Kit Library entry (search_kit) the section follows: its ui goes over the derived props. A connected agent must send it (422 kit_entry_required lists the 3 nearest) |
projectId | string | only needed for a workspace-wide key |
submit_componentize_receipt Record the sources a componentize run wrote
Record every section the componentize codemod extracted as its component's source. Call it right after `npx @bettercms-ai/convert --componentize --receipt componentize.json` (and after pushing the files): pass that receipt verbatim. Each extracted section is recorded as kind 'section' for the component with the same slug, so Output can build and validate it with no set_component_source per component. Answers which components were recorded, and any slug this project has no component for.
| Parameter | Type | Description |
|---|---|---|
receipt * | object | The receipt `npx @bettercms-ai/convert --componentize --receipt <file>` wrote, verbatim. |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
clear_component_source Remove a component's recorded source file
Remove the file recorded as a component's source (by set_component_source or a conversion receipt). Use it when the recorded file is wrong — Output then shows no source until the right file is recorded. Safe to call when nothing is recorded.
| Parameter | Type | Description |
|---|---|---|
componentId * | string | component id (from list_components) |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
declare_component_route Declare where a component's preview is served
Declare where this component's preview is served in the app (the dashboard's "Show preview"). Omit `path` to use the server's default route; pass `nativeViewports` only to check sizes other than the defaults. The origin is the project's preview URL and is never taken from you. Answers the readiness.
| Parameter | Type | Description |
|---|---|---|
componentId * | string | component id (from list_components) |
branchId | string | content branch id (from list_branches); omit to work on main |
nativeViewports | array | viewports to check; omit for the defaults |
path | string | route in the app that serves the preview; omit for the default |
projectId | string | list_projects id; workspace-wide grants only |
request_component_validation Request Output validation for a component
Ask for this component's Output to be validated by YOU, the connected agent (provider user-agent). Record its source first (set_component_source, or the componentize codemod plus a deploy): a component nothing renders is refused with 422 and the fix, and no request is opened. After a 202, run `npx @bettercms-ai/preview-runtime validate --local --request <requestId>` in the app's repository with BCMS_API_KEY set in the environment (never pass a key in a tool call), then read get_component_readiness. Your evidence is self-attested: publishing still needs the owner's Visual Approval in the dashbo…
| Parameter | Type | Description |
|---|---|---|
componentId * | string | component id (from list_components) |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
connect_native_ai Connect this client to the project's Native AI Connection
Connect this client to the project's Native AI Connection, so the dashboard shows it as an available executor. Call it ONCE when the user asks to connect — after that, ordinary tool calls on the same project keep it listed, and nothing needs to run on a timer. Idempotent. Returns the project it connected to and `presenceWindowMs`: the executor stays listed for that long after the last tool call, then drops off until the next one. THIS GRANTS NOTHING — it is presence only, and starting a run is still a human act in the dashboard. A 403 BRIDGE_GRANT_REQUIRED means this client is using a bare…
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
capabilities | array | optional — any of inspect, propose, implement, cancel, question. Defaults to inspect+propose+cancel. |
projectId | string | list_projects id; workspace-wide grants only |
list_media_folders List Media Library folders
The Media Library's folders (id, name, parentId, assetCount). Pass an id as `folderId` to list_media, upload_asset, attach_media_upload, update_media, generate_image or transform_image.
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
create_media_folder Create a Media Library folder
Create a Media Library folder (optionally inside `parentId`) and get its id. A folder only organises the library: it never changes an asset's URL. 409 FOLDER_EXISTS returns the id of the folder already there.
| Parameter | Type | Description |
|---|---|---|
name * | string | 1-80 chars |
branchId | string | content branch id (from list_branches); omit to work on main |
parentId | string | the folder to create it in (from list_media_folders); the library's top level when omitted |
projectId | string | list_projects id; workspace-wide grants only |
delete_form_submission Delete a form submission
Delete one form submission (lead) — e.g. to clear spam. Provide formId and submissionId (from list_form_submissions).
| Parameter | Type | Description |
|---|---|---|
formId * | string | |
submissionId * | string | |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
import_redirects Import redirects
Bulk-create redirects for a migration, from `rows` or from `text` in `format` (our CSV export, a Netlify `_redirects` file, or a vercel.json). Call it with `dryRun: true` FIRST: nothing is written and each row comes back `would-create`, `existing` or `skipped` with a reason. Rows get create_redirect's rules. Max 5000.
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
dryRun | boolean | default false |
format | string | of `text` (default 'csv') |
projectId | string | list_projects id; workspace-wide grants only |
rows | array | [{ sourcePath, destination?, redirectType? }] |
text | string | the file's contents, instead of rows |
save_reusable_block Save a section as a reusable block
Copy a page section (its layout, values and design) into Saved blocks in the section library, under `name`. The page is not changed; a block placed from Saved blocks is an independent section.
| Parameter | Type | Description |
|---|---|---|
blockId * | string | a top-level section id (get_page) |
name * | string | 80 characters at most; a longer one is refused as SAVED_BLOCK_NAME_TOO_LONG |
pageId * | string | |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
write_dock_ui Write custom dock UI
Save a custom dock input or panel (one .tsx `source`) as a new DRAFT version of `name` (a letter, then [a-z0-9-], ≤48), what `cms:<name>` imports resolve. Imports: react, react-dom, @bettercms-ai/kit/*, @bettercms-ai/dock-input, cms:<name>. Skill dock-input
| Parameter | Type | Description |
|---|---|---|
kind * | string | |
name * | string | a lowercase letter, then [a-z0-9-], at most 48 characters (a longer or digit-first name is refused as unservable) |
scope * | string | |
source * | string | .tsx, ≤256 KiB |
target * | object | per scope: field {modelId|pageId|componentId, path}, section {componentId}, page {pageId}, layout {} |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
approve_dock_ui Approve custom dock UI
Approve the newest `version` for publishing. Show the user the source first; userApproved: true only after their yes. A later write drops it
| Parameter | Type | Description |
|---|---|---|
name * | string | a lowercase letter, then [a-z0-9-], at most 48 characters (a longer or digit-first name is refused as unservable) |
version * | integer | |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
userApproved | boolean | true only after the user said yes to this version |
validate_dock_ui Validate custom dock UI
Check one version (default newest) without publishing: imports, size caps, a name the repo also has. Answers the build receipt
| Parameter | Type | Description |
|---|---|---|
name * | string | a lowercase letter, then [a-z0-9-], at most 48 characters (a longer or digit-first name is refused as unservable) |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
version | integer |
publish_dock_ui Publish custom dock UI
Publish an APPROVED version (default newest); rebuilds the dock UI release. `notShown`: published, not drawn, and the fix to tell the user
| Parameter | Type | Description |
|---|---|---|
name * | string | a lowercase letter, then [a-z0-9-], at most 48 characters (a longer or digit-first name is refused as unservable) |
action | string | unpublish: off the dock; delete: an unpublished source |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
version | integer |
list_dock_ui List custom dock UI
The project's dock UI sources (`notShown` when not drawn), usage, limits
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
scope | string | |
status | string |
write_schema Write a V2 schema
Write a kit V2 TypeSchema into a model (lane fields, as a change set; model: null creates) or a component's props (lane props). Run dryRun first: a write whose `loss` is not all in acceptLoss is refused schema.loss_not_accepted
| Parameter | Type | Description |
|---|---|---|
lane * | string | |
model * | model or component id/slug; null creates a model | |
schema * | object | { name, title, kind, fields, … } |
acceptLoss | array | loss keys or paths you accept |
branchId | string | content branch id (from list_branches); omit to work on main |
confirmed | boolean | true only after the user explicitly approved adding this custom input (`ui.input`), or a hide/fold/required→optional (else a named 409). Removing one needs no approval |
dryRun | boolean | |
ifMatch | integer | the dry run's `version`; needed to write over a stored row |
projectId | string | list_projects id; workspace-wide grants only |
read_schema Read the project's schema
Every content model and section component as a V2 TypeSchema: `{ model, lane, kit, version, schema }`, sorted lane then name. What `bettercms schema pull` writes to bettercms.schema.ts and write_schema takes back (`version` is its ifMatch). A section's `kit` is a search_kit id, never typed
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
get_workflow_board List editorial workflow stages
List the connected project's editorial board columns in order — each stage's `key`, name, and whether it is the `publishGate` (the one stage content may go live from). Read this BEFORE move_stage: stage keys are per-project and not guessable, because a project can rename or replace every column.
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
move_stage Move an entry or a page across the board
Move a content entry (`entryId`) or a page (`pageId`) to another editorial stage — this is how you take it OUT of review so it can be published. `workflowStage` is a stage key from get_workflow_board; pass `fromStage` to 409 if someone moved it first. Moving into the publish-gate stage is an approval and needs a publish-enabled connection. Publish afterwards with update_content_entry or update_page status:'published' — approving and publishing are deliberately two separate calls.
| Parameter | Type | Description |
|---|---|---|
workflowStage * | string | stage key from get_workflow_board |
branchId | string | content branch id (from list_branches); omit to work on main |
entryId | string | the entry to move; or send pageId |
fromStage | string | the stage you believe it is in — 409s if it has moved |
pageId | string | instead of entryId: the page to move |
projectId | string | list_projects id; workspace-wide grants only |
promote_project Promote staging → production
Promote the connected project's STAGED build to PRODUCTION — the one-click publish. Flips prod to the newest staged release (no rebuild) after the QA scan passes. Managed hosting only; needs a publish-enabled connection. 409 qa_blocked: the QA & Safety scan found critical issues. Read `summary` and every finding's title, detail, location and fix. A finding in the repository or the content: fix it, then call again. Shipping anyway is the same call with `force: true`, and only after the owner has seen these findings and said to ship.
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
force | boolean | true skips the QA & Safety gate (the override is audit-logged). Only on the owner's explicit word after they have seen the qa_blocked findings; never on your own. |
projectId | string | list_projects id; workspace-wide grants only |
list_entry_versions List a content entry's versions
List a content entry's version history (newest first) — each version's number, data snapshot, and when it was saved. Use it to find a past state to restore.
| Parameter | Type | Description |
|---|---|---|
entryId * | string | |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
restore_entry_version Restore a content entry to a past version
Restore a content entry to a past version (undo). Copies that version's data back as the current DRAFT (non-destructive). Publish afterwards to take it live. Provide entryId and the version number (from list_entry_versions).
| Parameter | Type | Description |
|---|---|---|
entryId * | string | |
version * | integer | |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
whoami Who this connection acts as
Who this connection acts as. Call it first when a call is refused for access. Returns the principal (`device_grant` from the connect flow, or `api_key`), the workspace, `scope` ('project' = bound to one project; 'workspace' = pass projectId on every project tool) and, where the server can see them, `grants`: content:publish takes content live, artifact:write runs the code and deploy tools; canChangeStructure gates only sidebar folders, never componentize or models (content:manage). `grants: null` means this server cannot see them, not that there are none. `workspace`, `owner` (the person who a…
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
set_authoring_preference Set the site's authoring architecture
Record which authoring architecture this site uses: 'components' (the default: reusable section components placed as blocks, which editors add, reorder and swap; on a site whose pages were DERIVED it keeps every field, value and binding, then run the componentize lane) or 'fields' (a typed field schema per page, for a blog, catalogue or directory). A deploy, a promote and every editor_setup record 'components' when nothing is set, so call this only to change it. Never ask the user: record it, say so in your final report, and tell them they can switch it in the dashboard.
| Parameter | Type | Description |
|---|---|---|
preference * | string | components or fields |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
prove_stega_parity Prove the stega locator for the live commit
Prove the stega locator for the commit that serves: built clean and built framed, compared page by page. 202 starts two builds (minutes); 409 NOTHING_LIVE: deploy first. Then set_binding_mode { locator: "stega" }: STEGA_PARITY_FAILED with no proof means still running; with `route`/`node`, clean that template's string with stegaClean, deploy, prove again. Requires artifact:write
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
clone_project Clone a project
Clone (duplicate) a project as a reusable template into the connected workspace. Copies pages, content models + entries, components, media, forms, and SEO/custom-code settings; excludes submissions, analytics, domains, and secrets. Returns the new project's id and slug. Omit sourceProjectId to clone the connected project.
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
name | string | |
projectId | string | list_projects id; workspace-wide grants only |
slug | string | |
sourceProjectId | string |
remove_page_fields Remove fields from a page
Delete page fields and their stored values (draft, published, every repeater row) in one transaction. Dry run by default: returns removedKeys, entriesWithContent, keysWithContent, liveCopyChanges and writes nothing. A field holding content needs discardContent:true (409 FIELDS_HOLD_CONTENT otherwise). keys: exact get_page keys, dotted for a group/repeater child (`features.icon`). Changing the live copy needs publish permission. Never use it to rename a field.
| Parameter | Type | Description |
|---|---|---|
keys * | array | field keys to remove |
pageId * | string | page id (from list_pages) |
branchId | string | content branch id (from list_branches); omit to work on main |
discardContent | boolean | delete fields that hold content, and the content |
dryRun | boolean | default true |
projectId | string | list_projects id; workspace-wide grants only |
create_deploy_upload Get a presigned deploy-upload URL
Get a presigned URL to upload a LARGE deploy archive directly to storage, bypassing the ~100 MB body limit deploy_project's inline `data` hits. Flow: (1) call this for `uploadUrl` + `uploadKey`; (2) PUT your .tgz/.zip to `uploadUrl` (e.g. `curl -X PUT --data-binary @archive.tgz "<uploadUrl>"`) — straight to storage, no size ceiling; (3) call deploy_project with `uploadKey`. Still exclude node_modules/.git/build caches. URL expires in 10 minutes.
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
update_field Change one field of a model or a page
Change ONE existing field of a content model (`modelId`) or of a page's schema (`pageId`), addressed by `path`: its key, or dot-separated keys through groups and repeaters ('hero.title'). Set its label, helpText, required, validation `config` (merged by key; null deletes one), showIf, requiredIf, compare, ui, placement, readOnly, lockReason, or the V2 helpMore, advanced, recommendedMax, openMode, localized and ai (null clears those; `sources` is server-owned and refused). The rest of the schema is written back unchanged at the version read; a 409 means it changed since, so read again. `type` c…
| Parameter | Type | Description |
|---|---|---|
path * | string | the field's key, or dot-separated keys through its parents, e.g. 'hero.title' |
advanced | boolean | null | true = a rare or developer setting: it collects in a closed 'Advanced' section |
ai | boolean | null | true = the editor offers its AI assist on this field |
allowFieldRemoval | boolean | with a rename: discard the old key's stored values |
allowRetype | boolean | confirm a type change, once the user has agreed |
branchId | string | content branch id (from list_branches); omit to work on main |
compare | same shape as on add_field; null clears it | |
config | object | per-type validation/config keys, merged into the stored config; null deletes a key |
confirmed | boolean | true only after the user explicitly approved adding this custom input (`ui.input`), or a hide/fold/required→optional (else a named 409). Removing one needs no approval |
helpMore | longer help behind the ⓘ next to the label, when one helpText line cannot carry it | |
helpText | string | null | one line; null = none, never refilled |
ifMatch | integer | the model's optimisticVersion; the version read when omitted |
key | string | a new key (unique among its siblings) |
label | string | |
localized | true = translations keep their own value (FIELD_NOT_LOCALIZED fix) | |
lockReason | as on add_field; null clears it | |
mergeHref | string | pageId only: the link field paired with `path` (the label). Both become ONE `button` field keyed `key` (default: their stem, primaryCtaHref → primaryCta). Each entry's DRAFT gets {label, href} and k… |
modelId | string | the content model (from list_content_models); or send pageId |
openMode | object/array/group/repeater: how the value (or each row) opens: 'inline', 'drill', 'popover' or 'dialog' | |
pageId | string | instead of modelId: the page whose schema to edit |
placement | ||
projectId | string | list_projects id; workspace-wide grants only |
readOnly | as on add_field; null clears it | |
recommendedMax | a SOFT limit (characters, items or value): the editor warns past it, never refuses | |
required | boolean | |
requiredIf | same shape as on add_field; null clears it | |
showIf | same shape as on add_field; null clears it | |
sources | ||
type | string | a new type; needs allowRetype |
ui | same vocabulary as on add_field; merged per key, a null key or ui:null clears |
search_content Search published content
Search the project's PUBLISHED pages and entries (the site-search index). Returns id, type ('page'|'entry'), title, slug and a snippet per hit; `type` narrows to one kind. `mode: 'semantic'` matches by meaning as well as words where AI search is on for the site; `meta.mode` says which ran and `meta.index.hybrid` whether meaning-based search is available. Drafts are not indexed: find those with list_content_entries `where`. `meta.unavailable` means site search is off for this project.
| Parameter | Type | Description |
|---|---|---|
q * | string | the words to find, 1-200 chars |
branchId | string | content branch id (from list_branches); omit to work on main |
limit | integer | hits to return; 10 when omitted |
mode | string | 'keyword' (default) or 'semantic': by meaning as well, where the site has AI search on |
projectId | string | list_projects id; workspace-wide grants only |
type | string | only pages, or only entries |
discard_draft Discard unpublished edits
Throw away unpublished edits to an entry (`entryId`) or a page (`pageId`) — exactly one: the draft returns to exactly what is live and `pendingChanges` becomes false. A page resets its blockJson and its published Layout overrides, not its field values: discard those by the `entryId` get_page `entryDraft` names. 409 no_published_version means it was never published (delete it instead). Pass ifMatch (optimisticVersion) to refuse if it changed since you read it.
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
entryId | string | the entry (from list_content_entries); or send pageId |
ifMatch | integer | optimisticVersion from get_content_entry or get_page |
pageId | string | instead of entryId: the page (from list_pages) |
projectId | string | list_projects id; workspace-wide grants only |
refresh_search_index Refresh IndexNow or site search
Tell search engines and site search about published changes; costs nothing. action 'indexnow' submits `urls` (this site's own, up to 1000) to IndexNow, or every change since the last submission when omitted. action 'reindex' rebuilds the project's site-search index. 503 means the index is unreachable: try again later.
| Parameter | Type | Description |
|---|---|---|
action * | string | 'indexnow' pings search engines; 'reindex' rebuilds site search |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
urls | array | indexnow only: this site's URLs; every change since the last submission when omitted |
give_feedback Send feedback to the BetterCMS team
Tell the BetterCMS team about a tool that failed, a capability you needed and did not have, or docs that misled you. Opens a ticket for the team; nothing in the project changes. Name the `tool`, and paste the request and response into `context`. Never include secrets or personal data.
| Parameter | Type | Description |
|---|---|---|
message * | string | what you tried, what happened and what you expected (1-10000 chars) |
branchId | string | content branch id (from list_branches); omit to work on main |
context | string | the request and response, or other detail (up to 4000 chars) |
kind | string | what went wrong; other when omitted |
projectId | string | list_projects id; workspace-wide grants only |
tool | string | the tool it is about, if any |
publish_entries Publish or unpublish many entries and pages
Publish or unpublish many entries and pages in ONE call (up to 100 ids of each; no page unpublish). Needs a publish-enabled connection, and each item still passes its own gates (editorial stage, required fields, an SEO title where its collection requires one: seo_title_required, and no field over its character limit: over_limit). Nothing stops the run: the result lists what changed (`published` or `unpublished`) and every refusal in `failed` with its reason. A publish answers 202 with the routes being rebuilt. `hold` keeps a live item's edits out of whole-site publishes, `release` includes the…
| Parameter | Type | Description |
|---|---|---|
action * | string | live, back to draft, or hold/release from site publishes |
branchId | string | content branch id (from list_branches); omit to work on main |
entryIds | array | entry ids (from list_content_entries) |
ifMatch | object | optional {id: optimisticVersion}: an item that changed since you read it is not published (failed: version_conflict) |
pageIds | array | page ids (from list_pages); not for unpublish |
projectId | string | list_projects id; workspace-wide grants only |
request_publish Hand drafts to the owner for publishing
You never publish: hand your drafts to the owner. Checks each item (waiting for review, differs from live, validation, a page's bindings) and records the request; the owner approves at `reviewUrl`. `items` default to every change waiting. `ok: false` names the failing check: fix it and request again. Then tell the owner what is ready; never ask them to re-authorize the connection
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
items | array | the changes to hand over; every change waiting when omitted |
note | string | what is ready, for the owner |
projectId | string | list_projects id; workspace-wide grants only |
create_content_entries Create many draft entries
Create up to 200 DRAFT entries of one collection in ONE call, each {slug?, data} as create_content_entry takes it. Every row reports `created` (with id and slug) or `failed` (with the error), a failure does not stop the others, and `meta` counts them. A row with `externalKey` is safe to send again: its entry is `updated` (draft only), or `unchanged` when the row is the same. A row setting a developer-locked field fails (FIELD_LOCKED). Publish afterwards with publish_entries.
| Parameter | Type | Description |
|---|---|---|
contentModelId * | string | the collection every entry belongs to (from list_content_models) |
entries * | array | 1-200 entries, each {slug?, data} |
branchId | string | content branch id (from list_branches); omit to work on main |
dryRun | boolean | validates and reports what would be written; writes nothing |
projectId | string | list_projects id; workspace-wide grants only |
translate_entry Translate an entry into another locale
Create an entry's `targetLocale` translation with AI (uses AI credits: 402/403 when out or not on the plan). Text and longtext fields are translated; rich text and documents are copied for you to translate; the rest is copied. The new entry is a DRAFT with `locale` set and `translationOf` = the source; `meta` lists translated and copied keys. `targetLocale` must be one of the project's locales; 409 locale_conflict means that translation exists, so edit it instead.
| Parameter | Type | Description |
|---|---|---|
entryId * | string | the SOURCE entry, never another translation |
targetLocale * | string | BCP-47 locale from the project's locales, e.g. 'fr' |
branchId | string | content branch id (from list_branches); omit to work on main |
fields | array | translate only these field keys |
projectId | string | list_projects id; workspace-wide grants only |
slug | string | the translation's slug; <source slug>-<locale> when omitted |
list_webhooks List webhooks
List the project's outgoing webhooks: name, url, events, whether active, and delivery health (total, failed, last attempt). Signing secrets are never returned.
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
create_webhook Create a webhook
Create an outgoing webhook: BetterCMS POSTs each subscribed event to your https `url`, signed with HMAC-SHA256 in X-BetterCMS-Signature. The response carries the signing `secret` ONCE: store it now. `test: true` also sends a sample delivery. Payloads carry ids and metadata, never the content: fetch it from the API. A receiver that writes back on content.updated loops unless it skips its own writes.
| Parameter | Type | Description |
|---|---|---|
name * | string | a label, 1-255 chars |
url * | string | the https endpoint that receives the events |
branchId | string | content branch id (from list_branches); omit to work on main |
events | array | events to send; ['content.publish'] when omitted |
isActive | boolean | default true |
projectId | string | list_projects id; workspace-wide grants only |
test | boolean | send a sample delivery now |
list_integrations List custom integrations
List the project's custom integrations (any vendor with a public API) and the workspace's integration `templates`. Each has its hosts, secret NAMES with `secretsPresent` (never a value), syncs, hooks, endpoints, functions and `approved`. Read bettercms://skill/integrations first.
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
get_integration Get a custom integration
One integration (`integration`: id or slug): `hookUrls`, `endpointUrls`, `oauthStatus`, its last sync runs, write-backs (`pushes`), function runs, webhook deliveries and vendor calls (the call log).
| Parameter | Type | Description |
|---|---|---|
integration * | string | the integration's id or slug (from list_integrations) |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
create_integration Create a custom integration
Declare a custom integration. Shapes: bettercms://skill/integrations. Secret VALUES never pass through here (the user sets env vars; list_env_vars shows names). Until an admin approves it, every vendor call, sync, webhook, endpoint and function is refused: give the user `approval.approveUrl` and `approval.changes` in plain words. You cannot approve it.
| Parameter | Type | Description |
|---|---|---|
name * | string | a label, 1-120 chars |
slug * | string | lowercase letters, digits, hyphens; at most 48 |
alertAfter | integer | tell admins after this many failed runs in a row (0 = never; 3 when omitted) |
allowPost | boolean | true lets requests other than GET through (vendor writes, POST search APIs such as Apollo's); GET only when omitted |
allowedHosts | array | exact hostnames the server may call, e.g. ['boards-api.greenhouse.io']; https only |
auth | optional token exchange (skill §5); its result is {{token}} | |
branchId | string | content branch id (from list_branches); omit to work on main |
endpoints | array | public reads for the site [{key, request, params, pick, cacheSeconds?}] (skill §11); at `endpointUrls` |
functions | array | [{name, triggers?, cpuMs?}]: bettercms/functions/<name>.ts (skill §10) |
hooks | array | vendor webhooks [{key, verify, action}] (skill §9); the vendor posts to `hookUrls` |
inject | object | where the secrets go on every vendor request: {headers?: {name: template}, query?: {name: template}}, templates {{secret.NAME}} or {{token}} |
oauth | sign-in with the customer's own OAuth app {authorizeUrl, tokenUrl, scopes, clientId, clientSecret} (secret NAMES; skill §13) | |
panel | the custom panel's slug: bettercms/panels/<panel>.tsx in the site repo; null for the stock page | |
projectId | string | list_projects id; workspace-wide grants only |
references | array | live references [{key, label, search, lookup, items, id, title}] (skill §12) |
secrets | object | template name (UPPER_SNAKE) -> project env var KEY, e.g. {TOKEN: 'SHOPIFY_ADMIN_TOKEN'}; never a value |
settings | object | non-secret JSON the panel reads and writes (store id, toggles); at most 16 KB |
syncs | array | vendor list -> collection [{key, contentModelId, request, items, externalKey, map, item?, writeBack?, publish?, schedule?}] (skill §6; two-way §15) |
vendor | string | the vendor's name, e.g. 'Greenhouse' |
update_integration Update a custom integration
Change an integration (`integration`: id or slug); parameters as create_integration, keys left out are kept, lists replace the stored ones whole. A change to hosts, secrets, inject, allowPost, auth, oauth, hooks, endpoints, references or functions withdraws its approval (`approval.approveUrl`); name, syncs, settings and panel never need it.
| Parameter | Type | Description |
|---|---|---|
integration * | string | the integration's id or slug (from list_integrations) |
alertAfter | integer | |
allowPost | boolean | |
allowedHosts | array | |
auth | ||
branchId | string | content branch id (from list_branches); omit to work on main |
endpoints | array | |
functions | array | |
hooks | array | |
inject | object | |
name | string | |
oauth | ||
panel | ||
projectId | string | list_projects id; workspace-wide grants only |
references | array | |
secrets | object | |
settings | object | |
syncs | array | |
vendor |
delete_integration Delete a custom integration
Delete an integration and its sync runs. Entries it synced stay (their provenance still names it); the env vars stay.
| Parameter | Type | Description |
|---|---|---|
integration * | string | the integration's id or slug (from list_integrations) |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
run_integration_sync Run an integration's sync
Run one of an integration's syncs now (`integration`, `sync`: its key): every page of the vendor list is fetched and each item is created or updated as a DRAFT entry, matched on its externalKey, so a re-run only changes what changed (`unchanged` counts the rest); `publish: true` on the sync publishes what changed. Answers with the run: queued, running, done (counts: created, updated, unchanged, failed, pages, items) or failed (error). `waitSeconds` (≤ 20) waits for it to finish; else follow it with get_integration. A sync with `schedule` 'hourly' or 'daily' also runs on its own.
| Parameter | Type | Description |
|---|---|---|
integration * | string | the integration's id or slug (from list_integrations) |
sync * | string | the sync's key (from the integration's syncs) |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
waitSeconds | number | wait up to N seconds (max 45) for it to finish; call again while it runs. In code mode one execute run's waits total under ~80 s: one wait a run |
run_integration_function Run an integration's function
Run an integration's function (bettercms/functions/<name>.ts, trigger 'manual') with `input`. Its fetch() reaches only the integration's approved hosts and the server adds the secrets: the code never sees them. `waitSeconds` (≤ 20) answers with output, logs or error.
| Parameter | Type | Description |
|---|---|---|
integration * | string | the integration's id or slug (from list_integrations) |
name * | string | the function's name |
branchId | string | content branch id (from list_branches); omit to work on main |
input | the function's `event` (JSON) | |
projectId | string | list_projects id; workspace-wide grants only |
waitSeconds | number | wait up to N seconds (max 45) for it to finish; call again while it runs. In code mode one execute run's waits total under ~80 s: one wait a run |
search_integration_reference Search an integration's live reference
Search an integration's live reference (`reference`: its key) at the vendor: up to 20 {id, title, image}. Store the pick in a json field (skill §12); the site resolves it live.
| Parameter | Type | Description |
|---|---|---|
integration * | string | the integration's id or slug (from list_integrations) |
reference * | string | the reference's key (from the integration's references) |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
query | string | what to search for |
start_integration_signin Start an integration's vendor sign-in
Start the vendor sign-in of an integration with `oauth`: a `url` the USER opens to sign in with their own OAuth app (register `redirectUri` in it first). Tokens stay on the server.
| Parameter | Type | Description |
|---|---|---|
integration * | string | the integration's id or slug (from list_integrations) |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
save_integration_template Save an integration as a template
Save an integration as a workspace template: its shape, never a secret value or its settings, with copies of the collections its syncs write into.
| Parameter | Type | Description |
|---|---|---|
integration * | string | the integration's id or slug (from list_integrations) |
branchId | string | content branch id (from list_branches); omit to work on main |
description | string | what it connects, for the people installing it |
name | string | a label, 1-120 chars |
projectId | string | list_projects id; workspace-wide grants only |
slug | string | lowercase letters, digits, hyphens; at most 48 |
install_integration_template Install an integration template
Install a workspace template on this project: missing collections are created and the integration waits for approval (`approval.approveUrl`); `secretsNeeded` lists the env vars to set.
| Parameter | Type | Description |
|---|---|---|
template * | string | the template's slug (from list_integrations `templates`) |
branchId | string | content branch id (from list_branches); omit to work on main |
name | string | a label, 1-120 chars |
projectId | string | list_projects id; workspace-wide grants only |
slug | string | lowercase letters, digits, hyphens; at most 48 |
test_integration_fetch Call a vendor through an integration
Call the vendor once through the server, as the integration: an approved host only, with the integration's `inject` secrets added server-side and every secret redacted from the answer. The request itself takes no {{...}} templates, and the token endpoint cannot be called. Use it to read the response shape before writing a sync: `items`, `externalKey` and `map` are JSON Pointers into it. Bodies over 1 MB come back truncated. 409 integration_not_approved: an admin must approve it first.
| Parameter | Type | Description |
|---|---|---|
integration * | string | the integration's id or slug (from list_integrations) |
url * | string | the full https URL on an allowed host (no templates in the URL) |
branchId | string | content branch id (from list_branches); omit to work on main |
headers | object | header -> value (no templates: the integration's inject adds the secrets) |
json | a JSON body for POST | |
method | string | GET when omitted |
projectId | string | list_projects id; workspace-wide grants only |
query | object | query parameter -> value (no templates) |
list_branches List content branches
List the project's content branches (id, name, slug, description, parent, status, applyAt, reviewStatus, whether main) and the `currentBranchId` this connection is on. `status`: 'open' (default), 'scheduled' (open with a go-live time), 'applied', 'abandoned' or 'all'; paged with `page`/`limit` (the open list comes whole when you pass neither). To work inside a branch, pass its id as `branchId` on any tool call; apply_branch merges it into its parent.
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
limit | integer | branches per page, 1-100; 25 when paged |
page | integer | 1-based page of `limit` rows; the response's meta says totalPages |
projectId | string | list_projects id; workspace-wide grants only |
status | string | open (default), scheduled, applied, abandoned or all |
create_branch Create a content branch
Create a content branch: a copy of the project's content to edit without touching the live site. Returns the branch; pass its id as `branchId` on later calls to work in it, then apply_branch. 409 means the name or slug is taken. `description` says what the branch is for (shown in the dashboard and in list_branches).
| Parameter | Type | Description |
|---|---|---|
name * | string | 1-80 chars |
branchId | string | content branch id (from list_branches); omit to work on main |
description | string | what the branch is for, up to 2000 chars |
projectId | string | list_projects id; workspace-wide grants only |
slug | string | derived from the name when omitted |
update_branch Rename or describe a branch
Rename a branch or set its description (null clears it). The slug and every preview link stay the same. To set when it goes live use apply_branch scheduleAt, which really schedules it. Main cannot be renamed.
| Parameter | Type | Description |
|---|---|---|
branchId * | string | the branch (from list_branches) |
description | what the branch is for, up to 2000 chars; null clears it | |
name | string | 1-80 chars |
projectId | string | list_projects id; workspace-wide grants only |
discard_branch_changes Take changes out of a branch
Take changes OUT of a branch: each change key (from apply_branch dryRun) is reset to the parent's state, so it no longer ships when the branch is applied or its schedule fires. The edits on those items in this branch are discarded and cannot be recovered; main and the live site are untouched. dryRun lists what would be reset. Refusals: BRANCH_IS_MAIN, BRANCH_APPLY_IN_PROGRESS; an unknown key fails alone (change_not_found), and so does a row added on the branch that a kept change still uses (still_used, usedBy).
| Parameter | Type | Description |
|---|---|---|
branchId * | string | the branch (from list_branches) |
changeKeys * | array | change keys from apply_branch dryRun, 1-100 |
dryRun | boolean | true = list what would be reset; write nothing |
projectId | string | list_projects id; workspace-wide grants only |
apply_branch Merge a branch into its parent
Merge a branch into its parent. dryRun: true returns the diff (changes, summary, conflicts) and writes nothing: ALWAYS read it and show the user first. `include` limits the merge to those change keys; `fields` resolves a conflicting field per change key ('keep_branch' or 'keep_parent'). `publish: true` takes the merged changes live in the same call; `scheduleAt` merges everything and publishes at that time instead (null cancels). Both need a branch made from main and a connection allowed to publish. 409 names unresolved conflicts, missing dependencies, or a merge already running.
| Parameter | Type | Description |
|---|---|---|
branchId * | string | the branch to merge (from list_branches) |
dryRun | boolean | true = return the diff and write nothing |
fields | object | change key → field → 'keep_branch' | 'keep_parent', for each conflict |
include | array | change keys to merge (from the diff); all when omitted |
projectId | string | list_projects id; workspace-wide grants only |
publish | boolean | true = also take the merged changes live, in the same call (a branch made from main) |
scheduleAt | ISO time to merge everything and publish then, instead of now; null cancels a schedule |
delete_branch Delete a branch an agent created
Discard a branch an agent created for this connection's owner (e.g. an "Agent edits" sandbox): nothing reaches main. Show the user apply_branch dryRun first. Needs the owner's publish grant. Named refusals: BRANCH_DELETE_NOT_GRANTED, BRANCH_NOT_YOURS, BRANCH_NOT_AGENT_CREATED, BRANCH_IS_MAIN, BRANCH_APPLY_IN_PROGRESS, 404 not open; the owner can delete it in the dashboard.
| Parameter | Type | Description |
|---|---|---|
branchId * | string | the branch to delete (from list_branches) |
projectId | string | list_projects id; workspace-wide grants only |
set_auto_deploy Turn Deploy on push on or off
Turn Deploy on push on or off (`enabled`). Off: call rebuild_project after each push; get_deploy_status `autoDeploy` says which. Needs the owner's grant (an Owner, or Admin with settings access, approved this connection). Refusals: AUTO_DEPLOY_NEEDS_OWNER_GRANT, AUTO_DEPLOY_NOT_A_MEMBER, AUTO_DEPLOY_OWNER_GRANT_REQUIRED, AUTO_DEPLOY_HEADLESS, NO_REPO_CONNECTED: relay and stop.
| Parameter | Type | Description |
|---|---|---|
enabled * | boolean | true: a push to the build branch builds and deploys; false: it does not (rebuild_project after pushing) |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
set_publish_goes_live Turn automatic publishing on or off
Turn "Publishing goes live automatically" on or off (`enabled`). On (the default): each publish puts that page or entry live right away, nothing else rebuilt. Off: publishes are saved and wait (a publish answers `delivery: "held"`); rebuild_project, Deploy in Hosting or a push puts everything waiting live together. Turning it back on puts what was waiting live now. get_deploy_status `publishGoesLive` says which. Git pushes are set_auto_deploy. Needs the owner's grant. Refusals: PUBLISH_GOES_LIVE_NEEDS_OWNER_GRANT, PUBLISH_GOES_LIVE_NOT_A_MEMBER, PUBLISH_GOES_LIVE_OWNER_GRANT_REQUIRED, PUBLISH_…
| Parameter | Type | Description |
|---|---|---|
enabled * | boolean | true: each publish puts that page or entry live right away; false: publishes wait for the next deploy (rebuild_project) |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
set_media_policy Choose where the site's media may live
Where the site's media may live (`mediaPolicy`). `cdn-only` (the default): images, video, PDFs and animations inside the site's code keep the setup incomplete (get_next_steps `media-bundled`) until `npx @bettercms-ai/cli@latest media cdn`, run in the repository, moves them to the media library. `allow-bundled`: the code may keep them; it needs the owner's grant (refusals MEDIA_POLICY_NEEDS_OWNER_GRANT, MEDIA_POLICY_NOT_A_MEMBER, MEDIA_POLICY_OWNER_GRANT_REQUIRED: relay and stop), so never set it to finish a setup. No `mediaPolicy`: reads it.
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
mediaPolicy | string | cdn-only: media only on the CDN (the default); allow-bundled: the code may keep it (owner's grant). Omit to read it |
projectId | string | list_projects id; workspace-wide grants only |
sign_media_url Sign a media URL for an exact render
Sign a media URL so the CDN renders exactly what it asks for (`url`: `/media/<id>[/<name>]?w=…&h=…&fit=…&quality=…&rect=…`, this project's assets only). Unsigned URLs are snapped to the standard widths (256-2400) and qualities (60/80/100); a signed one is served exactly and counts toward the site's monthly custom image sizes. Use it only for a size the standard ladder or a named preset (`?p=<name>`) does not cover.
| Parameter | Type | Description |
|---|---|---|
url * | string | a media URL of this project: /media/<id>[/<name>]?w=…&h=…&fit=…&quality=…&rect=… |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
rederive_page Re-derive one page (dry run first)
Re-derive one page from the live build with the plan's stored answers. Dry run by default: `preview` (added, retired, answers), nothing written; dryRun:false applies. Never over a person: 409 human-edits-unplaced names the edits with no place (`unfolded`): move them first.
| Parameter | Type | Description |
|---|---|---|
route * | string | the page's route, e.g. /docs/getting-started |
branchId | string | content branch id (from list_branches); omit to work on main |
dryRun | boolean | true (the default): report what would change and write nothing; false: apply |
projectId | string | list_projects id; workspace-wide grants only |
search_docs Search the BetterCMS docs
Search the BetterCMS documentation. Returns the best pages (title, url, breadcrumbs, snippet). Use it before guessing how a feature works; `meta.unavailable` means docs search is down right now.
| Parameter | Type | Description |
|---|---|---|
q * | string | the question or words to find |
branchId | string | content branch id (from list_branches); omit to work on main |
limit | integer | pages to return; 5 when omitted |
projectId | string | list_projects id; workspace-wide grants only |
read_docs Read one docs page
Read one BetterCMS documentation page as Markdown. Pass a `url` from search_docs (or a /docs/... path). 404 DOC_NOT_FOUND suggests the nearest pages; `meta.unavailable` means the docs are down right now. Code samples and tables are included; `meta.note` says when only the prose could be read, and `truncated: true` when the page was cut at 40 KB.
| Parameter | Type | Description |
|---|---|---|
url * | string | a url from search_docs, or a /docs/... path |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
patch_content_entries Patch parts of entries and pages
Change parts of up to 25 entries or pages without resending the rest: each item is {entryId or pageId, patches, ifMatch?} (for a page, ifMatch is its entry's optimisticVersion). A patch is one of set, setIfMissing, unset, inc, dec or insert {before|after|replace, items}, keyed by path: field keys (letters, digits, _ and -) joined by dots, an array row by [_key=="k"] (preferred) or [n], e.g. features[_key=="a1"].title or body[_key=="b3"].children[_key=="s1"].text. Never write "repeatable" in a path. Edits land on the DRAFT; publish with publish_entries. Each item reports patched, unchanged or f…
| Parameter | Type | Description |
|---|---|---|
items * | array | [{entryId or pageId, patches (1-50), ifMatch?}] |
branchId | string | content branch id (from list_branches); omit to work on main |
dryRun | boolean | validates and reports what would be written; writes nothing |
projectId | string | list_projects id; workspace-wide grants only |
validate_content Validate entries and pages without writing
Check up to 25 entries and pages (draft state) without changing them: field rules and required fields, references that point at nothing, keys the schema does not declare (stored before writes checked names, or saved with a FIELD_UNKNOWN warning), whether each would publish (`publishable`, `blockedBy`), native SEO problems and, for a page, components it places that are missing or unpublished. Each item is valid or invalid with `markers` {level, code, path, message}; `complete: false` names a check that could not run (an entry no page renders: its SEO is not checked). Run it before publish_entri…
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
entryIds | array | entries to check (with pageIds, 25 in all) |
pageIds | array | pages to check |
projectId | string | list_projects id; workspace-wide grants only |
list_guides List the BetterCMS guides
The playbooks and skill references BetterCMS ships (schema, structure, components, bindings, content modeling, forms, localization, media, SEO and more), each with a one-line description. They are the same texts as the bettercms:// resources, for a client or a code-mode run that cannot read resources. Read the ones your task needs with get_guides before you model a schema or build a page.
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
get_guides Read BetterCMS guides
Read up to 5 guides by name (from list_guides, e.g. "playbook/schema", "skill/components"). Load everything the task needs in ONE call. A guide longer than one response comes in `parts`, split where a section starts: read the next with `part`. One that does not fit beside the others comes back as {omitted: true}: ask for it alone. Unknown names are listed in `notFound`.
| Parameter | Type | Description |
|---|---|---|
names * | array | guide names from list_guides, e.g. "playbook/schema" |
branchId | string | content branch id (from list_branches); omit to work on main |
maxBytes | integer | the most guide text in one answer; 40000 when omitted |
part | integer | which part of a guide that comes in `parts`; 1 when omitted |
projectId | string | list_projects id; workspace-wide grants only |
get_usage This site's usage against its plan
This site's use against its plan in the current billing cycle, per meter (storage, bandwidth, api_requests, build_minutes, server_requests, server_cpu, transforms): used, limit, pct, and `state` (ok, w50, w70, w90, over, paused). Numbers are as of `asOf`, the last usage pass, not live. A paused meter is why a build, an image size or an API read is being refused; the owner changes the plan in the dashboard.
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
get_usage_history This site's usage over time
This site's metered usage over time. `period: 'cycle'` (default): each billing cycle's total and limit per meter, newest first, up to 24 cycles. `period: 'day'`: daily totals over at most 90 days between `from` and `to` (YYYY-MM-DD); a day with no usage is absent, and storage and transforms are not daily (`meta.excluded` says why). `metrics` narrows it. For where the site stands now use get_usage; for traffic use get_analytics_overview.
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
from | string | YYYY-MM-DD |
metrics | string | a comma list of meters, e.g. 'bandwidth,api_requests'; all when omitted |
period | string | 'cycle' (default): per billing cycle; 'day': daily totals, at most 90 days |
projectId | string | list_projects id; workspace-wide grants only |
to | string | YYYY-MM-DD |
generate_image Generate an image with AI
Generate an image with AI and add it to the Media Library (5 AI credits; free with the workspace's own Together key). `width`/`height` are 256-1440 in multiples of 16 (default 1024x768). Returns the new asset (id, url, altText): use the url as an 'image' field value. Always set `altText`. `attach` {entryId or pageId, path, append?} also sets the image on that draft field (path as in patch_content_entries); the asset is kept even if attaching fails.
| Parameter | Type | Description |
|---|---|---|
prompt * | string | what the image shows, 1-2000 chars |
altText | string | alt text for the new asset |
attach | object | {entryId or pageId, path, append?}: also set the image on that draft field (path as in patch_content_entries); append: true adds it to an array of images |
branchId | string | content branch id (from list_branches); omit to work on main |
folderId | string | Media Library folder id |
height | integer | |
projectId | string | list_projects id; workspace-wide grants only |
width | integer |
transform_image Edit an image with AI
Edit an existing Media Library image with an instruction (e.g. 'remove the background', 'make it dusk'); the result is saved as a NEW asset and the original is kept (5 AI credits). Returns the new asset (id, url, altText). `attach` {entryId or pageId, path, append?} also sets the result on that draft field (path as in patch_content_entries); without `mediaId` the image already at that path is the one edited. The asset is kept even if attaching fails.
| Parameter | Type | Description |
|---|---|---|
prompt * | string | the change to make, 1-2000 chars |
altText | string | alt text for the new asset |
attach | object | {entryId or pageId, path, append?}: also set the image on that draft field (path as in patch_content_entries); append: true adds it to an array of images |
branchId | string | content branch id (from list_branches); omit to work on main |
folderId | string | Media Library folder id |
mediaId | string | the image to edit (from list_media); with attach and no mediaId, the image at attach.path |
projectId | string | list_projects id; workspace-wide grants only |
write_alt_text Write alt text with AI
Alt text for a Media Library image (mediaId) or an https image URL (url), written from its pixels (1 AI credit). A suggestion: save it with update_media.
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
mediaId | string | the image (from list_media) |
projectId | string | list_projects id; workspace-wide grants only |
url | string | or an https image URL |
delete_component Delete a component
Delete a component (soft delete). 409 COMPONENT_IN_USE while a page, entry, Layout or other component still places it: `usages` names each; remove it there, then delete. 409 ORCHESTRATION_TARGET_ACTIVE or COMPONENT_IMPLEMENTATION_REQUEST_ACTIVE: a validation run targets it; tell the user.
| Parameter | Type | Description |
|---|---|---|
componentId * | string | component id (from list_components) |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
list_activity List project activity
Recent activity in the connected project — who changed what, and when. Filter by `category` (comma-separated: content, pages, media, forms, deployment, settings, members), `actorId`, or a `since`/`until` ISO window. At the start of a turn, pass `since` (your last look) to notice dashboard or agent edits made since.
| Parameter | Type | Description |
|---|---|---|
actorId | string | |
branchId | string | content branch id (from list_branches); omit to work on main |
category | string | |
limit | number | |
projectId | string | list_projects id; workspace-wide grants only |
since | string | |
until | string |
get_sections_pages Get the page list for convert --sections
The `--pages` input of `convert --sections`, for running it in your own checkout (componentize_sections { codemod: true } answered `skipped`). Save `data` to bcms-pages.json, run `npx @bettercms-ai/convert@latest --sections --add-sdk --pages bcms-pages.json --root . --receipt bcms-sections.json`, deploy, then submit_sections_receipt. `data.receipt`: the last run's
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
submit_sections_receipt Record what convert --sections did
Record what `convert --sections` did: its --receipt file, verbatim, as `receipt` (`commit`: the commit holding the run, if any). The setup gate reads which routes now draw the CMS section order and why the others were refused. A record: deploy for the site to change
| Parameter | Type | Description |
|---|---|---|
receipt * | object | The file `convert --sections --receipt` wrote, verbatim |
branchId | string | content branch id (from list_branches); omit to work on main |
commit | string | The commit the run made, when it made one |
projectId | string | list_projects id; workspace-wide grants only |
name_fields Name the fields the import guessed
The field names the import GUESSED (receipt.gate.naming: "Image 2", "Cta", "Third text"), read and fixed in bulk. Without `names`: the worklist, a batch of pages at a time, each row with its `address`, `label`, the `rule` it breaks, a `suggested` name where its words make one, its `route`, its `band` and its own `copy`. Open the band's source and name each for what its code says it holds, in one to three words ("Starter plan price"), never a guess. With `names` ({ address: label }, up to 500): each label is judged as any agent write is, beside the page's names after the batch, and written by c…
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
cursor | string | the worklist's `next`, for the next batch of pages |
names | object | { "<address>": "<label>" }: addresses as the worklist gives them (`<pageId>:<field path>`; a band's `<pageId>:<family>#section`) |
projectId | string | list_projects id; workspace-wide grants only |
decide_kit Name the kit entry of many sections
Name the kit entry of many section components in one call (the receipt's kit rows: a section with no entry, or the setup's derived one you would change). Each row is { componentId, entryId }: the entry's ui is rebuilt on the component's props as update_component { kitEntry } rebuilds it, and the choice is stored. Every section carries an entry: there is no "none". Find entries with search_kit and read one with get_kit_entry. A connected agent's row is refused kit_unfilled when the component does not fit the entry (its needed props unmapped, or a prop of no role of it), and a row is refused by…
| Parameter | Type | Description |
|---|---|---|
rows * | array | [{ componentId, entryId }]: each section component and the kit entry it is |
branchId | string | content branch id (from list_branches); omit to work on main |
check | boolean | true = say what would be stored, store nothing |
projectId | string | list_projects id; workspace-wide grants only |
get_analytics_overview Get traffic overview
Traffic totals and the daily series for the connected project: views, unique visitors, bytes, sessions, bounces and responses by status class. Defaults to the last 30 days; pass `from`/`to` as YYYY-MM-DD, and `compare: "previous"` for the previous period's totals beside them.
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
compare | string | |
from | string | |
projectId | string | list_projects id; workspace-wide grants only |
to | string |
get_analytics_top_pages Get top pages
The most-viewed paths on the live site, with views and bytes. Pass `errors: true` instead for the paths that answered 4xx/5xx (path, status, hits): what the overview's 4xx and 5xx counts are, over the last 14 days at most. Defaults to the last 30 days; pass `from`/`to` (YYYY-MM-DD) and `limit`.
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
errors | boolean | |
from | string | |
limit | number | |
projectId | string | list_projects id; workspace-wide grants only |
to | string |
get_analytics_top_referrers Get top referrers
Traffic sources: the referrer hosts sending visitors, by views. Defaults to the last 30 days; pass `from`/`to` (YYYY-MM-DD) and `limit`.
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
from | string | |
limit | number | |
projectId | string | list_projects id; workspace-wide grants only |
to | string |
get_analytics_breakdown Get traffic breakdown
Views and visitors by one dimension: `country` (ISO code), `device` (desktop, mobile, tablet), `browser` or `crawler` (the bots that fetched the site). Defaults to the last 30 days; pass `from`/`to` (YYYY-MM-DD) and `limit`.
| Parameter | Type | Description |
|---|---|---|
dim * | string | |
branchId | string | content branch id (from list_branches); omit to work on main |
from | string | |
limit | number | |
projectId | string | list_projects id; workspace-wide grants only |
to | string |
get_conversions Get conversions
Conversions: form submissions (the one goal a site measures) per form over the last `days` days (default 30, max 90), with last-7 vs previous-7, all-time spam, the pages each form is on, and the site's conversion rate (submissions per 100 page views). `degraded: true` means the submissions store didn't answer, so the counts are not measurements and the rate is null.
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
days | integer | |
projectId | string | list_projects id; workspace-wide grants only |
get_ai_traffic Get AI traffic
AI traffic: crawler visits for AI products (GPTBot, ClaudeBot…, beside search crawlers) and visitors referred by answer engines (ChatGPT, Perplexity…), with totals. Pro plan and above. Defaults to the last 30 days; pass `from`/`to` (YYYY-MM-DD).
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
from | string | |
projectId | string | list_projects id; workspace-wide grants only |
to | string |
list_ai_reports List AI report runs
Past AI report runs for the connected project — `kind` is 'links' (internal linking) or 'aeo' (AI-answer readiness). Read-only history; starting a run stays a dashboard action.
| Parameter | Type | Description |
|---|---|---|
kind * | string | |
branchId | string | content branch id (from list_branches); omit to work on main |
limit | number | |
projectId | string | list_projects id; workspace-wide grants only |
generate_pages_from_dataset Generate many pages from a dataset
Turn a dataset into many pages at once (programmatic SEO from a keyword list, or ABM pages from an account list). Give a template `pageId`, a `mapping` (contentModelId, a slugTemplate like 'for-{{company}}', and per-field values that are either a column name or {ai:{prompt}}), and `rows`. For an ABM campaign set `mapping.campaign.id` and the run fans out across every page that campaign owns, returning one job id per page in `jobIds`. ALWAYS call with dryRun:true first and show the sample — a real run parks for approval and must be released with approve_ai_job.
| Parameter | Type | Description |
|---|---|---|
mapping * | object | |
pageId * | string | |
rows * | array | |
branchId | string | content branch id (from list_branches); omit to work on main |
dryRun | boolean | |
projectId | string | list_projects id; workspace-wide grants only |
list_ai_jobs List bulk jobs
Recent bulk jobs for the connected project with status and progress. Use it to report how a generation is going.
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
get_ai_job Get a bulk job
One bulk job — its `type` (generate, seo, rename, migrate, publish, unpublish, research), status, rows processed, rows created, conflicts, and the approval plan if it is still parked. `rowResults` is the per-row ledger: every row that FAILED or was skipped, with a reason code, which is the only place “20 rows in, 18 pages out” is explained. `summary` splits a rerun into added / updated / unchanged, and `campaignId` / `collectionSlug` say which campaign and collection the pages landed in.
| Parameter | Type | Description |
|---|---|---|
jobId * | string | |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
approve_ai_job Approve a bulk job
Release a job that is awaiting approval so the queue can run it. Only call this when the USER has said yes — never approve your own plan unprompted.
| Parameter | Type | Description |
|---|---|---|
jobId * | string | |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
reject_ai_job Reject a bulk job
Discard a job awaiting approval. Nothing was charged and nothing was written.
| Parameter | Type | Description |
|---|---|---|
jobId * | string | |
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
get_editable_plan Get the owner's open questions
Choices the platform can't make alone: `rows`, `options`, `recommended`. Per row: if confident, answer via confirm_editable_plan, tell the owner; else ask them, recommended first. Never leave an unsure one unasked; always ask `orphan` rows. Repeated links with extras (a badge) are a list: `group`; see `ifGrouped`.
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
confirm_editable_plan Record the owner's answers
Record answers: each `decisions` item is an option's `decision`, placeholders filled in. `check: true` = dry run. At most 100 a call: send more in batches; `retry` holds what to send again (a stale answer on its hash now, and any past the cap).
| Parameter | Type | Description |
|---|---|---|
decisions * | array | |
branchId | string | content branch id (from list_branches); omit to work on main |
check | boolean | |
projectId | string | list_projects id; workspace-wide grants only |
list_hosting_connections List hosting connections
The Vercel, Netlify and Cloudflare accounts connected to this workspace (id, provider, accountLabel, status; never a token), plus `connectUrl`, the dashboard page where a person connects one. Call it before deploy_to_host. If the provider the user wants has no connection with status `ok`, give the user `connectUrl` to connect it in their browser and stop until they have: you never handle OAuth or a host token yourself.
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
deploy_to_host Deploy to Vercel or Netlify
Deploy this project to the user's own Vercel or Netlify account through their connection. BetterCMS builds the site and the host serves that build (skill publishing). The first call creates the site on the host and makes it the project's host; a later call for the same provider redeploys that site (`redeployed: true`). `connectionId` (from list_hosting_connections) defaults to the newest working one, `siteName` to the project's handle. A refusal carries a `code` and a `fixUrl` (not_connected, reconnect, pick_existing_site, grant_required, ADMIN_REQUIRED): each is fixed by the user at `fixUrl`,…
| Parameter | Type | Description |
|---|---|---|
provider * | string | |
branchId | string | content branch id (from list_branches); omit to work on main |
connectionId | string | a connection id from list_hosting_connections; defaults to the newest working one |
projectId | string | list_projects id; workspace-wide grants only |
siteName | string | lowercase letters, numbers and hyphens; defaults to the project's handle |
get_host_deploy_status Get host deploy status
The connected project's recent deployments to Vercel, Netlify or Cloudflare, newest first: state (queued|deploying|live|failed), providerUrl, error, sha and targetName. Poll it after deploy_to_host until the newest one is `live`, whose `providerUrl` is the live URL to hand the user, or `failed`, whose `error` you read back to them.
| Parameter | Type | Description |
|---|---|---|
branchId | string | content branch id (from list_branches); omit to work on main |
projectId | string | list_projects id; workspace-wide grants only |
review_branch_preview Ask for a branch preview review
Ask the team to review a design variant (a git branch preview): `action` 'submit', or 'withdraw' to take the request back. `previewId` is an `id` from get_deploy_status `previews[]`. Members who may publish are told in the app and by email. You can never approve or merge: a person approves in the dashboard and an admin merges. A push resets the review, so submit again once the new commit is live. Preview builds read main's PUBLISHED content: create new fields or models on main first.
| Parameter | Type | Description |
|---|---|---|
action * | string | |
previewId * | string | an id from get_deploy_status previews[] |
branchId | string | content branch id (from list_branches); omit to work on main |
note | string | |
projectId | string | list_projects id; workspace-wide grants only |