Skip to main content
Glama

ui_builder_replace_design_document

Destructive

Replace one stored design from a complete DesignDocumentV1 copy — the authoritative save-back and re-import operation. The document must name the same design and the same canonical home you read from ui_builder_get_design; baseRevision must still be current. The runtime validates the complete document and quotas, preserves server-owned identity, access and creation time, retains the old revision, and broadcasts a whole snapshot. Retry with the same operationId; never invent a new id after a lost response. Unless the person already chose to save back or re-import onto this home, call first with dryRun: true: it changes nothing and returns the choices to put to them — or, when your client supports form elicitation on this connection, asks them in a form and returns the outcome of the write they chose.

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": {
      "designId": "<designId>",
      "operationId": "<operationId>",
      "baseRevision": "<baseRevision>",
      "document": "<document>"
    },
    "name": "ui_builder_replace_design_document"
  }
}

Input 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.
dryRunNoValidate and return the person's choices without changing anything.
designIdYes
documentYesThe complete replacement DesignDocumentV1, including the existing home.
agentNameNoOptional agent/client name shown to design viewers; self-reported.
agentModelNoOptional current model name shown to design viewers; self-reported. Omit when unknown.
operationIdYesYour stable id; makes a retry idempotent.
baseRevisionYesThe exact current revision being replaced.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added
  2. Removed
  3. 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"
      +}
  4. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "type": "object"
      +}
  5. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Well beyond the annotations, which only say non-read-only, destructive and not idempotent: the description discloses validation against the complete document and quotas, preservation of server-owned identity/access/creation time, retention of the old revision, and a whole-snapshot broadcast. It also explains keyed idempotency via operationId, which refines rather than contradicts idempotentHint=false (that hint covers ordinary repeat calls, not same-id retries).

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?

Front-loaded with the core operation, then ordered by precondition, runtime behavior, retry, and dryRun guidance — a sensible sequence. It is dense and multi-clause, and the dryRun/form-elicitation sentence is long, though each clause carries actionable information rather than filler.

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 destructive, nested-object, 8-parameter write with an output schema already covering returns, the description supplies everything an agent needs: identity/home match requirement, revision currency, validation and quota behavior, retry protocol, and the dryRun-first protocol. Nothing material 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 coverage is 88%, so the baseline is 3, but the description adds real meaning for the two highest-risk parameters: baseRevision must still be current, and operationId is the stable retry key. It also constrains document to a complete DesignDocumentV1 naming the existing home, which the schema only gestures at. token and agentName/agentModel are left to the schema, which already documents them.

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 ("Replace one stored design") and scopes it precisely as the authoritative save-back/re-import path, which distinguishes it from read-path siblings like ui_builder_get_design and from partial-edit siblings like rename/move/restore. An agent can tell what this does and what it is the canonical way to do 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 Guidelines5/5

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

Gives an explicit precondition ("must name the same design and the same canonical home you read from ui_builder_get_design", baseRevision current) and an explicit when-first rule: call with dryRun: true unless the person already chose to save back. The retry rule (same operationId, never invent a new one after a lost response) is also spelled out, leaving little to inference.

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.