Skip to main content
Glama
WebCake Storefront MCP

WebCake Storefront MCP

by vuluu2k

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

NameRequiredDescriptionDefault
seoNoSEO 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).
nameYesPage name
slugYesURL 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).
typeNoPage 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).
sourceYesFull page source { sections: [...] } (object or JSON string), or the source_ref "cache:clone-<id>" from clone_page
dry_runNoPreview+validate only (true) or create+save (false)
native_gapNoOnly if custom_code is refused and no native way exists: the need, what you checked, what it lacks.
custom_codeNoPer-page custom code saved with the page (same slots as update_page_custom_code). Last resort — native first.
is_homepageNoSet as the site homepage

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv2.17.0
    • removedInput schema / properties / custom_code / additionalProperties
      Removed value: -false
    • removedInput schema / properties / seo / additionalProperties
      Removed value: -false
    • changedInput schema / properties / source / description
      Previous value: -"Full page source { sections: [...] } (object or JSON string), or the source_ref \"cache:clone-N\" from clone_page"New value: +"Full page source { sections: [...] } (object or JSON string), or the source_ref \"cache:clone-<id>\" from clone_page"
    • changedInput schema / required
      Previous value: -[
      -  "name",
      -  "slug"
      -]New value: +[
      +  "name",
      +  "slug",
      +  "source"
      +]
  2. Changed3 schema fields changedv2.8.0
    • addedInput schema / properties / custom_code
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Per-page custom code saved with the page (same slots as update_page_custom_code). Last resort — native first.",
      +  "properties": {
      +    "code_before_body": {
      +      "description": "HTML after this page's content, before its scripts (noscript pixel, widget mount point). \"\" clears.",
      +      "type": "string"
      +    },
      +    "code_before_head": {
      +      "description": "HTML for <head> on this page only (<script src>, <link>, <meta>). \"\" clears.",
      +      "type": "string"
      +    },
      +    "code_custom_css": {
      +      "description": "CSS for this page (no <style> needed). Target #ELEMENT-ID or .custom_class. \"\" clears.",
      +      "type": "string"
      +    },
      +    "code_custom_javascript": {
      +      "description": "Plain JS for this page, NO <script> tag; runs at the end of <body>. \"\" clears.",
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
    • addedInput schema / properties / native_gap
      Added value: +{
      +  "description": "Only if custom_code is refused and no native way exists: the need, what you checked, what it lacks.",
      +  "minLength": 30,
      +  "type": "string"
      +}
    • changedInput schema / properties / source / description
      Previous value: -"Full page source { sections: [...] } (object or JSON string)"New value: +"Full page source { sections: [...] } (object or JSON string), or the source_ref \"cache:clone-N\" from clone_page"
  3. First observedv1.31.8

TDQS

A4.5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations only declare readOnlyHint=false, and the description adds substantial behavioral context beyond that: dry_run defaults to true, validation errors block the real save, duplicate creation returns blocked:true, and special page types auto-enable the corresponding site data source. These are non-obvious side effects and error semantics that materially affect how an agent should call the tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The primary purpose and the dry-run safety protocol are front-loaded in the first two sentences, with the type/slug restrictions following as supporting constraints. It is dense but every paragraph carries a distinct rule; the only mild cost is that the uniqueness paragraph packs several conditions into one block.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 9-parameter mutation tool with nested objects and no output schema, the description covers the important gaps: why dry_run exists, what blocks a save, and what a blocked duplicate returns. The main missing piece is what a successful non-dry_run call returns (e.g. the new page id), which an agent would need to chain further calls.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already documents name, slug, type, seo, custom_code and dry_run in detail; the baseline would be 3. The description adds cross-parameter meaning the schema doesn't state on its own — that source must be { sections: [...] } built with new_section, and that dry_run is a two-phase validate-then-save protocol — which earns it a notch above baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb+resource pair: "Create a brand-new page AND set its full content source in one step." It further constrains the scope with the uniqueness rules for 'main'/'error'/'maintain' types versus repeatable 'custom' pages, so an agent can distinguish this from a generic page-editing or cloning tool without reading the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives an explicit usage pattern — call with dry_run=true (the default) first, then dry_run=false — and states a when-not case: if a duplicate slug/type exists, edit the returned existing page_id instead. It stops short of naming the concrete edit/clone sibling tools, so the alternative is described behaviorally rather than by name.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.