ui_builder_view
See a design the way a person in the editor sees it: a PNG of the canvas with the overlays drawn on — the selection outline, the reference picture when one is attached, the discussion's comments pins, and the layout bounds — and beside it JSON with the revision, each visible node's id and box, each pin's thread and position, all in the returned image's pixels. The picture is a short-lived signed https link by default; inline: true puts the bytes in the reply as well. The frame is the PNG export (renderer: "export", the editor's own renderer), which reports no node boxes; renderer: "native" draws real Compose on a host with a native render lane, reports every node's box so the selection can be outlined, and needs the ui-builder-export capability. With no renderer, a non-empty selection is drawn on the native frame when the host has a lane and the caller the capability, and otherwise on the export with a note saying why it is not outlined. A node with no box is reported in notes, never drawn at a guessed position. For a wff-watchface design, frames (2-12) over durationMs, or explicit times, draws the face at several instants instead — use it to check motion: a second hand's sweep, a seconds pulse, anything driven by [SECOND_MILLISECOND], [MILLISECOND] or [UTC_TIMESTAMP] — and ambient: true draws ambient mode (alone: interactive and ambient side by side, to check the transition). The reply is one picture, by default a filmstrip grid with each frame labelled by its UTC time (format: "animated" makes an animated PNG), and motion lists each frame's time, box and hash, with distinctFrames saying whether anything moved. Frames are drawn by the editor's renderer on unsaved copies, at most 12 a call and 6 calls a minute per account; a design that pins environment.fixedTime shows that instant in every frame. It is an occasional look, not a per-edit check: watchFaceCost on each edit stays the per-edit cost signal. Not an McpResponseEnvelopeV1.
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_view"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| times | No | wff-watchface only: the exact instants to draw, in epoch milliseconds, instead of `frames` and `durationMs`. | |
| token | No | A 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. | |
| format | No | With motion frames: `filmstrip` (default) is one labelled PNG grid, the easiest to read; `animated` is an animated PNG. | |
| frames | No | wff-watchface only: draw this many frames spread evenly over `durationMs`, starting at the current whole second. Defaults to 6 when only `durationMs` is given. | |
| inline | No | Also return the PNG as an image block. Defaults to false; a host with no public origin always does. | |
| ambient | No | wff-watchface only: draw the frames in ambient mode, applying the design's `wff/variant mode=AMBIENT` overrides. Alone, draws the interactive and ambient modes side by side. | |
| include | No | Overlays to draw. Defaults to comments, reference, selection; [] draws the bare frame. | |
| designId | Yes | ||
| renderer | No | Defaults to export, or native when a selection is to be outlined and this host and grant can render it. | |
| revision | No | A past revision. Omit for the current one. | |
| viewport | No | Fit the picture inside this many pixels, keeping its aspect ratio. Omit for the render's own size. | |
| agentName | No | Optional agent/client name shown to design viewers; self-reported. | |
| selection | No | Node ids to show as selected. | |
| agentModel | No | Optional current model name shown to design viewers; self-reported. Omit when unknown. | |
| durationMs | No | wff-watchface only: the window the frames cover, in milliseconds. Defaults to 1000. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| frame | Yes | ||
| image | Yes | ||
| nodes | No | ||
| notes | No | ||
| motion | No | ||
| schema | Yes | ||
| include | Yes | ||
| comments | No | ||
| designId | Yes | ||
| renderer | Yes | ||
| revision | Yes | ||
| reference | No | ||
| selection | Yes | ||
| imageBase64 | No | ||
| boundsUnavailable | No |