build_page
Creates a new storefront page and sets its full section-based content source in one step. Use dry-run validation before saving to preview and prevent invalid pages.
Instructions
Create a brand-new page AND set its full content source in one step. Two-step safety: call with dry_run=true (default) to validate and preview, then dry_run=false to actually create + save. The source must be { sections: [...] } — build sections with new_section. Validation errors block the real save. ONE page per site for type main (homepage) / error / maintain, and slugs are unique per site: a duplicate is refused (dry_run reports blocked:true) and you get the existing page_id to edit instead. Only 'custom' pages can be created over and over.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"name": "<name>",
"slug": "<slug>",
"source": "<source>"
},
"name": "build_page"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| seo | No | SEO for this page → settings.seo. Without it the page publishes with an EMPTY title/description. For a store page a good default title is '{{name_product}} | {{name_site}}' (product) or '{{name_category}} | {{name_site}}' (category). | |
| name | Yes | Page name | |
| slug | Yes | URL slug WITHOUT a leading slash, e.g. 'about', 'collections', 'cart'. A leading '/' is stripped automatically (the storefront matches the bare path segment, so '/cart' would 404). Store pages MUST use the conventional slugs: category='collections', product detail='products', cart='cart', checkout='checkout', thank-you='complete'. The homepage needs no slug (pass is_homepage:true). | |
| type | No | Page kind. SPECIAL pages need a site data-source enabled — build_page does this automatically: store→use_store (product/cart bindings), member→use_member (customer/order bindings), blog→use_blog, error→use_error, maintain→use_maintain. 'main'/'custom' need nothing. Omit for a normal content page (defaults to 'main' for the homepage). | |
| source | Yes | Full page source { sections: [...] } (object or JSON string), or the source_ref "cache:clone-<id>" from clone_page | |
| dry_run | No | Preview+validate only (true) or create+save (false) | |
| native_gap | No | Only if custom_code is refused and no native way exists: the need, what you checked, what it lacks. | |
| custom_code | No | Per-page custom code saved with the page (same slots as update_page_custom_code). Last resort — native first. | |
| is_homepage | No | Set as the site homepage |