Skip to main content
Glama

ui_builder_validate

Check a design without saving it: a whole document, a stored design by designId, or operations against a stored design exactly as ui_builder_apply would apply them. Runs the same checks the real call does — document shape, catalog pin, the catalog's own validation, the mutation reducer — and then the Compose export gate, which is the list the editor's problems panel shows. Returns {valid, problems:[{severity, source, code, message, nodeId?, field?, operationIndex?}]}; valid is false exactly when a problem is an error. Nothing is written, no revision moves and nobody watching the design is notified. The shapes are published as the resources compose-preview://schemas/ui-builder-document-v1.json and compose-preview://schemas/design-mutation-v1.json.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tokenNoA grant token from poll_access, when you cannot set the X-Compose-Preview-Token header yourself — an MCP client fixes its headers at connect time, so this is how a token approved during this session is used in it. Prefer the header where you control it.
designIdNoA stored design to check, or to check `operations` against.
documentNoA whole DesignDocumentV1 to check.
agentNameNoOptional agent/client name shown to design viewers; self-reported.
agentModelNoOptional current model name shown to design viewers; self-reported. Omit when unknown.
operationsNoDesignMutationV1 objects to check against `designId`'s current document, as ui_builder_apply takes them.
baseRevisionNoThe revision the operations were written against; a stale one is reported as a warning.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
validYes
schemaYes
designIdNo
problemsYes
revisionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / agentModel
      Added value: +{
      +  "description": "Optional current model name shown to design viewers; self-reported. Omit when unknown.",
      +  "maxLength": 80,
      +  "type": "string"
      +}
    • addedInput schema / properties / agentName
      Added value: +{
      +  "description": "Optional agent/client name shown to design viewers; self-reported.",
      +  "maxLength": 80,
      +  "type": "string"
      +}
  2. Added

TDQS

A4.3/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden and does so well: it lists the exact checks performed (document shape, catalog pin, catalog validation, mutation reducer), describes the export gate, and states side-effect guarantees ('Nothing is written, no revision moves and nobody watching the design is notified') plus the `valid` semantics. This is rich behavioral disclosure beyond what any structured field supplies.

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 definition is front-loaded with the three modes before descending into mechanism, and nearly every clause carries information. It is dense but slightly overpacked — the inline return-shape literal and the schema resource URIs could be trimmed given an output schema already exists — so it is not maximally economical.

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?

For a complex, multi-mode validation tool with nested objects, the description covers side effects, the check pipeline, the returned shape, and where the input shapes are published as resources. With an output schema and 100% parameter coverage already present, nothing an agent needs to invoke it correctly is missing.

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 description coverage is 100%, so the baseline is 3, but the description adds meaningful framing by explaining how the parameters relate — `operations` are checked against `designId`'s current document 'as ui_builder_apply takes them,' and `baseRevision` is tied to the operations. That relational context is not fully captured by the individual schema entries.

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

Purpose4/5

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

The description states a specific verb and resource ('Check a design without saving it') and enumerates the three input modes it accepts: a whole `document`, a stored `designId`, or `operations` against a stored design. It clearly separates itself from `ui_builder_apply` by emphasizing nothing is written, though it never explicitly distinguishes itself from the sibling `ui_builder_check_design`, which an agent could easily confuse it with.

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 clear context for use — validating operations 'exactly as ui_builder_apply would apply them' before committing — which implies the dry-run use case and names the relevant alternative. However, it offers no explicit 'when not to use' guidance and does not route the agent away from `ui_builder_check_design` or `ui_builder_get_design`.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.