Skip to main content
Glama

ui_builder_apply

Apply design mutations — insertNode, setProperty, deleteNode, moveNode and the rest of DesignMutationV1 — as one operation. baseRevision is the revision you read; the outcome reports conflicts or rejected edits. This is how an agent adds a scaffold, fills its slots and sets modifiers. Use setStateVariable with name and declaration to add or edit state, removeStateVariable with name to remove unused state, and setEventBinding with nodeId, event and an ordered actions array to edit behavior. An empty actions array removes the event handler. These are the same edits as Screen > State and Properties > Actions in the browser. removeNodeProperty (or a setProperty whose value is {"type":"null"}) unsets the property — the way back after trying one — and is refused, naming the node and the field, when the catalog requires it. When somebody has commented on the design and you have not acknowledged it, the outcome carries a comments block naming the threads waiting on you; read it, because it is somebody talking about what you are editing. To recover a design whose catalog pin stopped resolving, send the apply object ui_builder_preview_catalog_recovery returns: one upgradeCatalog mutation, alone in its batch, at the preview's baseRevision, with the preview's candidateDocumentHash as its targetDocumentHash.

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>",
      "operations": "<operations>"
    },
    "name": "ui_builder_apply"
  }
}

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.
clientIdNo
designIdYes
agentNameNoOptional agent/client name shown to design viewers; self-reported.
agentModelNoOptional current model name shown to design viewers; self-reported. Omit when unknown.
operationsYesDesignMutationV1 objects. State example: {"type":"setStateVariable","name":"expanded","declaration":{"type":"value","valueType":"bool","initialValue":false,"nullable":false,"persistence":"preview"}}. Event example: {"type":"setEventBinding","nodeId":"button","event":"click","actions":[{"type":"toggle","variable":"expanded"}]}. Declare state before binding it in the batch.
operationIdYesYour id for this operation; makes a retry idempotent.
baseRevisionYesThe revision these mutations were written against.

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.5/5.0
Behavior5/5

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

Goes well past the annotations: it explains baseRevision semantics, that the outcome reports conflicts or rejected edits, that unsetting properties is refused with the node and field named when the catalog requires it, that an empty actions array removes a handler, and that a comments block appears when unacknowledged threads exist. The operationId idempotency note in the schema sits alongside idempotentHint=false without contradicting it (retry deduplication, not natural idempotency).

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 action before branching into mutation-specific and recovery detail, and every clause carries operational content. It is dense and slightly meandering by the final catalog-recovery sentence, but nothing is filler.

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?

An output schema exists so return values need no explaining, yet the description still usefully characterizes the outcome (conflicts, rejections, comments block). The main residual gap is that operations items are an untyped object and 'the rest of DesignMutationV1' is never fully enumerated, leaving the mutation vocabulary partly external.

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?

With 75% schema coverage the schema already carries much of the load, but the description adds real meaning: baseRevision is 'the revision you read,' state must be declared before binding it in the batch, and specific parameter names (name, declaration, nodeId, event, actions) are tied to their mutations. The token, clientId, agentName and agentModel parameters are left entirely to the schema.

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?

Opens with a specific verb and resource — 'Apply design mutations ... as one operation' — and enumerates the concrete mutation kinds (insertNode, setProperty, deleteNode, moveNode) plus the DesignMutationV1 family. It also implicitly separates this batch-apply path from the preview/recovery tool it references by name, so an agent can tell what it is 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?

Strong when-to-use guidance: 'This is how an agent adds a scaffold, fills its slots and sets modifiers,' plus per-mutation routing (setStateVariable with name/declaration, removeStateVariable with name, setEventBinding with nodeId/event/actions) and a concrete recovery recipe using ui_builder_preview_catalog_recovery. No explicit exclusion against overlapping siblings like ui_builder_edit_design or ui_builder_editor_write, so the agent gets context but not a clear 'prefer this over that' rule.

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.