Skip to main content
Glama

ui_builder_put_asset

Idempotent

Put a picture behind an assetKey, so an asset/image node naming that key draws it instead of a placeholder. Send the PNG, JPEG, GIF or WebP bytes base64-encoded in imageBase64; the server stores them by content digest and pins {mediaType, contentDigest, source: uploaded} into the design's assets map under the key. This moves the design's revision, and the reply carries the new one to quote as baseRevision. Idempotent by content — the same bytes under the same key change nothing. Put the picture first, then insert the asset/image node with ui_builder_apply: the reducer refuses a key that is neither pinned in the design nor in the catalog's own registry. A pinned key whose bytes a lane cannot show renders as a visible placeholder, never as an error.

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>",
      "assetKey": "<assetKey>",
      "imageBase64": "<imageBase64>"
    },
    "name": "ui_builder_put_asset"
  }
}

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.
assetKeyYes1 to 64 characters of letters, digits, '.', '_' or '-'; what the node's assetKey property names.
designIdYes
agentNameNoOptional agent/client name shown to design viewers; self-reported.
agentModelNoOptional current model name shown to design viewers; self-reported. Omit when unknown.
imageBase64YesThe image bytes, base64. At most 1 MiB decoded.

Output Schema

NameRequiredDescriptionDefault

No arguments

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. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "type": "object"
      +}
  5. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false and idempotentHint=true, but the description goes well beyond them: it discloses that the design revision moves and the reply carries the new revision to quote as `baseRevision`, that idempotency is by content (same bytes, same key, no change), and that unsupported lanes render a visible placeholder rather than an error. Only auth/permission specifics are left to the schema's `token` field, so this is rich but not exhaustive.

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?

The core purpose and the base64 payload requirement are front-loaded, and most sentences carry distinct operational facts (formats, storage model, revision bump, ordering constraint, idempotency, placeholder fallback). It runs long and packs several constraints into the same block, but almost nothing is redundant.

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 mutating upload with an output schema, the description covers everything the agent needs: input encoding, size/format limits, the side effect on the design revision, the value to reuse as `baseRevision`, and the downstream ordering requirement. Return-value shape is handled by the output schema, so no gap remains.

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 83%, so the baseline is 3, and the description adds real meaning: it names the accepted formats (PNG, JPEG, GIF, WebP) that the schema omits, clarifies that bytes go base64-encoded in `imageBase64`, and ties `assetKey` to the node's `assetKey` property. It does not add anything about `token`, `designId`, `agentName`, or `agentModel`, but those are already schema-documented.

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 sentence gives a concrete verb and resource — store an image behind an `assetKey` so an `asset/image` node renders it instead of a placeholder — which is unmistakable against siblings like ui_builder_apply or ui_builder_export. It also states the storage model (content digest, pinned `{mediaType, contentDigest, source: uploaded}` entry in the design's `assets` map), so an agent knows exactly what changes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly sequences this tool before ui_builder_apply ('Put the picture first, then insert the `asset/image` node with ui_builder_apply') and explains why: the reducer refuses a key that is neither pinned in the design nor in the catalog registry. That is a concrete when-to-use rule plus the failure it prevents, leaving little to inference.

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.