Skip to main content
Glama

ui_builder_simulate_action

Read-only

Run a stored design's host logic — the JavaScript in its hostLogic that stands in for the host feeding it, answering host actions by setting host inputs — headless, without a browser: init, then each of actions in order, as the editor's canvas runs it. Each action is {"name": …, "value": …}, exactly what a design's host action sends (a value is text, a whole number or a decimal; omit it for none). Returns summary first, then ok and steps: for init and each action, the program's private state, every host input's values as the canvas would draw them, which inputs the step set, and the error when its answer could not be used. A failing step keeps the values before it and the next action is still sent; a program that overruns its budget stops the run (stopped). Use it to show the logic works (a calculator shows 3 after 1 + 2 =) and to find which key breaks it. Nothing is saved. At most 200 actions.

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

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.
actionsNoHost actions to answer, in order, after init. Omit to run init alone.
designIdYes
revisionNoA past revision. Omit for the current one.
agentNameNoOptional agent/client name shown to design viewers; self-reported.
agentModelNoOptional current model name shown to design viewers; self-reported. Omit when unknown.

Output Schema

NameRequiredDescriptionDefault
okYes
stepsYes
digestNo
schemaYes
stoppedNo
summaryYes
designIdYes
revisionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added
  2. Removed
  3. Added

TDQS

A4.4/5.0
Behavior5/5

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

Annotations only say readOnlyHint=true; the description adds substantial context: it runs headless with no browser, nothing is saved, failing steps retain prior values and execution continues, and a budget overrun halts the run (`stopped`). That is behavior an agent could not infer from the annotations.

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?

Content is front-loaded with purpose followed by execution order, result shape, and failure semantics, with no filler sentences. It is dense to the point of being a single wall of prose, which slightly hurts scanability.

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 simulation tool with an output schema, this covers initiation, action sequencing, return structure, per-step errors, budget stopping, and side-effect absence. 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.

Parameters3/5

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

Schema coverage is 83%, so the schema already documents the parameters well; the description largely restates the action shape (`name`/`value`, text or number, omitted for none). It adds only the ordering semantic (actions run after `init`, omit to run init alone), which is modest value over 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?

States a precise verb and resource: run a stored design's host logic (`hostLogic`) headless, executing `init` then each action in order. The scope is unambiguous and clearly distinct from inspection siblings like ui_builder_check_design or ui_builder_open.

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 concrete use cases — showing the logic works (a calculator showing 3 after `1 + 2 =`) and finding which key breaks it — plus the operational boundary of at most 200 actions. It does not name a sibling alternative or state when not to use it, so it falls short of a 5.

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.