Skip to main content
Glama

ui_builder_render_design_matrix

Read-only

See one design on several devices in ONE picture: a contact sheet with a captioned cell per device × theme × font scale, plus each cell's device, size and box on the sheet. Nothing is saved — the design's environment is swapped on a scratch copy for each cell. Name devices by preset (phone_small, phone, phone_landscape, foldable_folded, foldable_unfolded, tablet_portrait, tablet_landscape, wear_small_round, wear_large_round, wear_square, tv_1080p, widget_small_round, widget_small_squircle, widget_small_rectangular, widget_large_round, widget_large_squircle, widget_large_rectangular) or as {widthDp, heightDp, label?, round?}; or a formFactor (phone, foldable, tablet, wear, tv, widget, adaptive) for its default set; with neither you get the design's own form factor — phone, foldable and tablet for a mobile catalog, the round watches for Wear, and for a Wear widget (a widget-container-* root) its own container in each widget host: Samsung round, Pixel Watch squircle and rectangular, at the container's frame. Widget host cells are drawn natively in that host when the caller holds ui-builder-export and the host has a native lane (renderer: "native"); otherwise by the editor's export, masked to the host's outline. Add themes: ["light","dark"] and fontScales: [1, 2] to cross them; at most 16 cells. The sheet is a short-lived signed https link kept under 3.5 MB, so a chat surface can show it inline; inline: true puts the bytes in the reply as well.

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

Input Schema

NameRequiredDescriptionDefault
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.
inlineNoAlso return the PNG as an image block. Defaults to false; a host with no public origin always does.
themesNoDefaults to the design's own theme.
devicesNoDevices to draw. Omit for the form factor's defaults.
designIdYes
revisionNoA past revision. Omit for 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.
fontScalesNoDefaults to the design's own font scale.
formFactorNoA default device set, instead of `devices`.

Output Schema

NameRequiredDescriptionDefault
rowsYes
cellsYes
imageYes
schemaYes
columnsYes
summaryYes
designIdYes
revisionYes
imageBase64No

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added
  2. Removed
  3. Changed4 schema fields changed
    • changedInput schema / properties / devices / items / anyOf
      Previous value: -[
      -  {
      -    "enum": [
      -      "phone_small",
      -      "phone",
      -      "phone_landscape",
      -      "foldable_folded",
      -      "foldable_unfolded",
      -      "tablet_portrait",
      -      "tablet_landscape",
      -      "wear_small_round",
      -      "wear_large_round",
      -      "wear_square",
      -      "tv_1080p"
      -    ],
      -    "type": "string"
      -  },
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "formFactor": {
      -        "type": "string"
      -      },
      -      "heightDp": {
      -        "maximum": 4096,
      -        "minimum": 1,
      -        "type": "integer"
      -      },
      -      "id": {
      -        "type": "string"
      -      },
      -      "label": {
      -        "type": "string"
      -      },
      -      "round": {
      -        "type": "boolean"
      -      },
      -      "widthDp": {
      -        "maximum": 4096,
      -        "minimum": 1,
      -        "type": "integer"
      -      }
      -    },
      -    "required": [
      -      "widthDp",
      -      "heightDp"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "enum": [
      +      "phone_small",
      +      "phone",
      +      "phone_landscape",
      +      "foldable_folded",
      +      "foldable_unfolded",
      +      "tablet_portrait",
      +      "tablet_landscape",
      +      "wear_small_round",
      +      "wear_large_round",
      +      "wear_square",
      +      "tv_1080p",
      +      "widget_small_round",
      +      "widget_small_squircle",
      +      "widget_small_rectangular",
      +      "widget_large_round",
      +      "widget_large_squircle",
      +      "widget_large_rectangular"
      +    ],
      +    "type": "string"
      +  },
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "formFactor": {
      +        "type": "string"
      +      },
      +      "heightDp": {
      +        "maximum": 4096,
      +        "minimum": 1,
      +        "type": "integer"
      +      },
      +      "id": {
      +        "type": "string"
      +      },
      +      "label": {
      +        "type": "string"
      +      },
      +      "round": {
      +        "type": "boolean"
      +      },
      +      "widthDp": {
      +        "maximum": 4096,
      +        "minimum": 1,
      +        "type": "integer"
      +      }
      +    },
      +    "required": [
      +      "widthDp",
      +      "heightDp"
      +    ],
      +    "type": "object"
      +  }
      +]
    • changedInput schema / properties / formFactor / enum
      Previous value: -[
      -  "phone",
      -  "foldable",
      -  "tablet",
      -  "wear",
      -  "tv",
      -  "adaptive"
      -]New value: +[
      +  "phone",
      +  "foldable",
      +  "tablet",
      +  "wear",
      +  "tv",
      +  "widget",
      +  "adaptive"
      +]
    • addedOutput schema / properties / cells / items / properties / renderer
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ]
      +}
    • addedOutput schema / properties / cells / items / properties / widgetHostShape
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ]
      +}
  4. 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"
      +}
  5. Added

TDQS

A4.5/5.0
Behavior5/5

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

Beyond the readOnlyHint annotation it discloses that nothing is persisted, that the environment is swapped on a scratch copy per cell, that the sheet is a short-lived signed https link capped at 3.5 MB, and that native rendering depends on the caller holding ui-builder-export. It also explains the fallback path (native lane vs editor export masked to the host outline). That is substantial behavior beyond the annotation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose and side-effect guarantees are front-loaded and well organized, but a long parenthetical enumerates all seventeen device preset strings that the schema enum already lists verbatim — a large block of redundant text that dilutes the otherwise tight prose.

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 ten-parameter rendering tool with an output schema and a readOnly annotation, the description covers the remaining unknowns: persistence, link lifetime and size ceiling, inline byte delivery, revision handling context, and the permission-dependent native rendering path. Nothing needed 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 90%, so the baseline is 3; the description earns above that by explaining the precedence and defaults between `devices` and `formFactor` (including which form factor a mobile catalog, Wear, or a widget-container root yields) and the interaction that crosses themes × fontScales into at most 16 cells. That combination rule is meaning the schema cannot express.

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?

The opening states a specific verb and output artifact: 'See one design on several devices in ONE picture: a contact sheet with a captioned cell per device × theme × font scale.' That distinguishes it from single-device render siblings and from catalog-level matrices without needing the schemas.

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?

It tells the agent when this tool applies (multi-device comparison in one image) and what to pass: presets, explicit {widthDp,heightDp} objects, a `formFactor` default set, or nothing at all with a documented fallback per catalog type. What it lacks is an explicit routing statement such as 'for a single device use render_native instead'.

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.