Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
fitNoHow 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).
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.
nodeIdsNoLayers to match against the reference, each with a proposed alignment.
designIdYes
rendererNoWhich render to measure. Defaults to native when nodeIds is given, export otherwise.
revisionNoMeasure this revision. Defaults to 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.
differencesNoMeasure where the frame differs. Defaults to true.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
factsYes
notesNo
layersNo
schemaYes
designIdYes
rendererYes
revisionYes
referenceYes
differencesNo
differencesMessageNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. 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"
      +}
  2. Added

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so: it explicitly states 'Nothing is written', explains the pixelComparable caveat, notes that nodeIds needs an export grant while differences alone uses the PNG export, and warns to treat confident:false as a hint rather than an edit. This is unusually rich behavioral disclosure.

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 and each sentence carries distinct information. The single dense paragraph with heavy em-dashes and nested parentheticals strains readability slightly, but little is wasteful.

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 9-parameter tool with an output schema, the description supplies the comparability caveat, the renderer/permission dependency, the meaning of the returned regions and alignment operations, and the confident flag semantics. Nothing an agent needs to call it correctly is missing.

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?

Schema coverage is 89% (baseline 3), and the description adds genuine value beyond it: fit defaults to facts.recommendedFit, renderer defaults to native when nodeIds is given and export otherwise, and nodeIds triggers native rendering. It stops short of covering every param, but meaningfully supplements 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 specific verb+resource: 'Measure a design against its reference overlay.' It also names the enabling sibling (ui_builder_set_reference) and the downstream tools (ui_builder_apply, ui_builder_view), so an agent can place it precisely in the workflow.

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 strong workflow context — attach a reference first, apply the returned operations, then re-compare and view. However, it does not distinguish itself from potentially overlapping siblings like ui_builder_check_design or ui_builder_validate, so the when-not-to-use guidance is absent.

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.