ui_builder_compare_reference
Measure a design against its reference overlay (attach one with ui_builder_set_reference). Returns what the picture is against the frame and whether a pixel comparison means anything (facts.pixelComparable — a 328×56 dp crop stretched over a screen is not comparable until measured at its actual size); with differences, the share of pixels that differ and up to eight regions in dp, each with the layer it falls in; and for each of nodeIds, where that layer sits in the reference — from a box drawn over it in the editor, or a search of the reference's pixels, which for text also reads the font size — with the alignment that would make it agree (move, size, font size) and the exact operations to pass to ui_builder_apply. Nothing is written: apply the operations you agree with, then compare again and look with ui_builder_view. Layer matching needs node boxes, so nodeIds measures the native render (an export grant); differences alone use the PNG export. Treat confident: false as a hint to check, not an edit to make.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fit | No | How the picture is placed: contained and centred, across the width from the top, or at its own size from the top-left. Defaults to the fit the picture calls for (facts.recommendedFit). | |
| 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. | |
| nodeIds | No | Layers to match against the reference, each with a proposed alignment. | |
| designId | Yes | ||
| renderer | No | Which render to measure. Defaults to native when nodeIds is given, export otherwise. | |
| revision | No | Measure this revision. Defaults to the current one. | |
| agentName | No | Optional agent/client name shown to design viewers; self-reported. | |
| agentModel | No | Optional current model name shown to design viewers; self-reported. Omit when unknown. | |
| differences | No | Measure where the frame differs. Defaults to true. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| facts | Yes | ||
| notes | No | ||
| layers | No | ||
| schema | Yes | ||
| designId | Yes | ||
| renderer | Yes | ||
| revision | Yes | ||
| reference | Yes | ||
| differences | No | ||
| differencesMessage | No |