Skip to main content
Glama
WebCake Storefront MCP

WebCake Storefront MCP

by vuluu2k

validate_page

Read-only

Checks a page source against each element’s schema, flagging save-blocking errors and rendering warnings before build_page and showing code-based fixes.

Instructions

Validate a page source ({ sections: [...] }) against every element's schema. Each message reads [CODE] #id (type) where: problem → fix. errors block saving (duplicate/missing ids, renderer-crash shapes…); warnings render wrong (UNKNOWN_KEY invented/misspelled key, STYLE_KEY not a CSS property, TYPE_MISMATCH, BAD_VALUE outside the allowed values, BAD_PARENT, OUTSIDE_FORM, FIELD_NAME, EVENT/BINDING problems…). Repeated warnings are collapsed per code; summary.by_code counts all. Always run this before build_page and fix by code.

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": {
      "source": "<source>"
    },
    "name": "validate_page"
  }
}

Input Schema

NameRequiredDescriptionDefault
sourceYesPage source object or JSON string
page_idNoJudge it as that page's save would: its kind + the site's popups / global sources (dangling event targets and record bindings become errors)
page_kindNoPage kind when there is no page yet (build_page type)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.17.0
    • addedInput schema / required
      Added value: +[
      +  "source"
      +]
  2. Changed2 schema fields changedv2.8.0
    • addedInput schema / properties / page_id
      Added value: +{
      +  "description": "Judge it as that page's save would: its kind + the site's popups / global sources (dangling event targets and record bindings become errors)",
      +  "type": "string"
      +}
    • addedInput schema / properties / page_kind
      Added value: +{
      +  "description": "Page kind when there is no page yet (build_page type)",
      +  "enum": [
      +    "main",
      +    "store",
      +    "member",
      +    "blog",
      +    "custom",
      +    "error",
      +    "maintain"
      +  ],
      +  "type": "string"
      +}
  3. First observedv1.31.8

TDQS

A4.1/5.0
Behavior3/5

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

The readOnlyHint annotation already tells the agent this is a safe non-mutating call, so the description's main contribution is the severity model: errors block saving, warnings render wrong, warnings are collapsed per code while summary.by_code counts all occurrences. That is genuinely useful behavioral context. It stops short of describing the return payload's overall shape (only summary.by_code is named), leaving some guesswork about how to read results.

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

Conciseness5/5

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

Front-loaded with the core action in the first clause, then severity semantics, then the workflow instruction ("Always run this before build_page"). The parenthetical code enumerations are dense but each names a concrete failure class an agent will need to interpret, so no sentence is expendable.

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

Completeness5/5

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

With no output schema, the description carries the burden of explaining results and does so: message format `[CODE] #id (type) where: problem → fix`, error vs. warning severity, per-code deduplication, and summary.by_code counts. Combined with 100% param coverage in the schema and readOnlyHint, an agent has what it needs to call and interpret the tool.

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

Parameters3/5

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

Schema description coverage is 100%, so page_id and page_kind semantics are already fully documented in the input schema (including that page_id applies save-kind and popup/global-source context). The description only adds a hint about the source shape ({ sections: [...] }), which is mild added value over "Page source object or JSON string." Baseline 3 is appropriate.

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?

States a specific verb and resource ("Validate a page source ... against every element's schema") and scopes it further by telling the agent this is a pre-build check, which distinguishes it from build_page. An agent can tell what the tool does and what it operates on without opening 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?

Gives clear sequencing guidance ("Always run this before build_page and fix by code") and implies validation before saving via the errors-block-saving note. It does not spell out when to skip validation or what alternative to use if you already know the source is valid, so it falls short of a full when/when-not treatment.

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