Skip to main content
Glama

ui_builder_set_reference

Idempotent

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.

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_set_reference"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameNoWhat the editor calls it. An `@2x` suffix declares the density.
clearNoRemove the reference, its marks and pieces instead.
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.
densityNoThe picture's pixels per dp, e.g. 2 for a 2x export, 2.625 for a Pixel screenshot.
designIdYes
agentNameNoOptional agent/client name shown to design viewers; self-reported.
sourceUrlNoWhere it came from, such as the Figma frame URL. Provenance only; never fetched.
agentModelNoOptional current model name shown to design viewers; self-reported. Omit when unknown.
imageBase64NoThe picture, base64. PNG, JPEG, WebP or SVG; at most the host's reference size limit.

Output Schema

NameRequiredDescriptionDefault
factsNo
notesNo
schemaYes
attachedYes
designIdYes
referenceNo

Schema Changelog

Changes observed during successful MCP inspections.

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

TDQS

A4.3/5.0
Behavior5/5

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

Beyond the annotations (idempotent, non-destructive write), it discloses the exact side effects: the overlay is never part of the design, no node holds it, no export sees it, and the revision does not move. It also warns that marks are kept while alignment is reset, that the image is stored on the host, and that the reply reports size/density and whether pixel comparison is meaningful.

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?

Purpose and the destructive-sounding `clear` option are front-loaded, and each subsequent sentence carries distinct information (sourcing, density defaults, side effects, consent). It is dense and long for a single tool, but very little of it is filler.

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 nine-parameter mutation tool with an output schema, this covers everything an agent needs: where the image comes from, what density to declare, what survives and what resets, what the response reports, and the privacy constraint. Nothing material 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 already 89%, yet the description adds real meaning: accepted image formats for `imageBase64`, the `@2x` name-suffix density convention, and — most usefully — the default interpretation when `density` is omitted (screen-shaped images read across frame width, others at the design's own density). The `sourceUrl` provenance-only, never-fetched behavior is also clarified.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource: attach a picture as a design's reference overlay, or `clear` it. It even names the editor surface the result appears in ('Frame, density and reference panel'). It never names a sibling such as ui_builder_compare_reference, so the boundary against alternatives is left to inference rather than stated.

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?

Clear context for when to call it (a picture a design is being built against) and explicit instructions for sourcing it: fetch the Figma screenshot yourself and pass the URL, because 'this host fetches nothing itself'. It also imposes a consent rule for user-supplied images ('attach it only with their permission'). It stops short of stating when to prefer this over the comparison or implementation-setting siblings.

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.