ui_builder_set_reference
Attach the picture a design is being built against — a Figma frame, a screenshot of a shipped screen, a mock — as its reference overlay, or clear it. The same overlay the browser editor's Frame, density and reference panel shows, so a person opening the design sees what you attached. Kept beside the design and never part of it: no node holds it, no export sees it, the revision does not move. Send PNG, JPEG, WebP or SVG bytes in imageBase64. For a Figma frame, fetch the picture with your Figma tools (a screenshot of the node) and pass the frame's URL as sourceUrl; this host fetches nothing itself. State the export scale as density (2 for a Figma 2x export) or in the name (card@2x.png): without it a screen-shaped picture is read across the frame's width and anything else at the design's own density. The reply says what the picture is against the frame — size in dp, density, whether it is a screen or a region — and whether pixel comparison means anything. Marks drawn in the editor are kept; the alignment is reset, as a new picture in the editor does. A user-supplied image is stored on this host: say so, and attach it only with their permission.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | What the editor calls it. An `@2x` suffix declares the density. | |
| clear | No | Remove the reference, its marks and pieces instead. | |
| 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. | |
| density | No | The picture's pixels per dp, e.g. 2 for a 2x export, 2.625 for a Pixel screenshot. | |
| designId | Yes | ||
| agentName | No | Optional agent/client name shown to design viewers; self-reported. | |
| sourceUrl | No | Where it came from, such as the Figma frame URL. Provenance only; never fetched. | |
| agentModel | No | Optional current model name shown to design viewers; self-reported. Omit when unknown. | |
| imageBase64 | No | The picture, base64. PNG, JPEG, WebP or SVG; at most the host's reference size limit. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| facts | No | ||
| notes | No | ||
| schema | Yes | ||
| attached | Yes | ||
| designId | Yes | ||
| reference | No |