Skip to main content
Glama

Preview Card

preview_card
Read-onlyIdempotent

Render ONE authored card on its own and SEE it, before placing it in a composition. Pass the same html (+ optional tokens) you would put in a {kind:"card"} clip; you get the still back as an image. Use this while writing a card — it is the fast loop for catching type that overflows the frame, a headline that collides with a logo, or tokens that did not resolve. Sized to the format you name, so what you see is what that aspect ratio will show. To judge MOTION rather than layout, shell the card with a motion preset and use preview_clip.

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": {
      "projectId": "<projectId>",
      "html": "<html>"
    },
    "name": "preview_card"
  }
}

Input Schema

NameRequiredDescriptionDefault
htmlYesThe card markup, exactly as it would appear in a {kind:"card"} clip source.
tokensNoToken substitutions the html references (e.g. brand colours, fonts). Same shape as the clip source `tokens`.
commandIdNoRetry identity. A call repeated with the same commandId returns the first result instead of acting twice.
projectIdYesprojectId (path) — the card is rendered inline; nothing is persisted to the project.
aspectRatioNoFrame to size the card into. Default 9:16 — a card that fits 16:9 often overflows vertical.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed12 schema fields changed
    • addedInput schema / $defs
      Added value: +{
      +  "__schema0": {
      +    "additionalProperties": {
      +      "type": "string"
      +    },
      +    "propertyNames": {
      +      "type": "string"
      +    },
      +    "type": "object"
      +  },
      +  "__schema1": {
      +    "enum": [
      +      "16:9",
      +      "9:16",
      +      "1:1",
      +      "4:5"
      +    ],
      +    "type": "string"
      +  },
      +  "__schema2": {
      +    "maxLength": 128,
      +    "minLength": 1,
      +    "type": "string"
      +  }
      +}
    • addedInput schema / properties / aspectRatio / $ref
      Added value: +"#/$defs/__schema1"
    • removedInput schema / properties / aspectRatio / enum
      Removed value: -[
      -  "16:9",
      -  "9:16",
      -  "1:1",
      -  "4:5"
      -]
    • removedInput schema / properties / aspectRatio / type
      Removed value: -"string"
    • addedInput schema / properties / commandId / $ref
      Added value: +"#/$defs/__schema2"
    • removedInput schema / properties / commandId / maxLength
      Removed value: -128
    • removedInput schema / properties / commandId / minLength
      Removed value: -1
    • removedInput schema / properties / commandId / type
      Removed value: -"string"
    • addedInput schema / properties / tokens / $ref
      Added value: +"#/$defs/__schema0"
    • removedInput schema / properties / tokens / additionalProperties
      Removed value: -{
      -  "type": "string"
      -}
    • removedInput schema / properties / tokens / propertyNames
      Removed value: -{
      -  "type": "string"
      -}
    • removedInput schema / properties / tokens / type
      Removed value: -"object"
  2. Changed1 schema field changed
    • addedInput schema / properties / commandId
      Added value: +{
      +  "description": "Retry identity. A call repeated with the same commandId returns the first result instead of acting twice.",
      +  "maxLength": 128,
      +  "minLength": 1,
      +  "type": "string"
      +}
  3. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, so safety is covered. The description adds real context beyond them: the result is a still image returned inline, nothing is persisted, and the frame is sized to the named aspect ratio so the preview matches the final crop. Return payload structure and any render failure behavior are not described, keeping it below a 5.

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, then usage loop, then the sibling hand-off — a sensible order. It is slightly long for a five-parameter read-only tool, with some rhetorical phrasing ('SEE it', 'what you see is what that aspect ratio will show') that could be tightened.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a read-only preview tool with no output schema, the description covers input provenance (card markup + tokens), output form (a still image), and framing behavior. Only edge cases — invalid html, unresolved tokens, or render failures — are left unaddressed, which are minor for this complexity.

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?

With 100% schema coverage the baseline is 3, but the description adds cross-tool semantics the schema cannot: html must be exactly what a {kind:"card"} clip source would carry, and tokens must match that same shape. It does not restate the aspectRatio enum or commandId retry semantics, which the schema already handles.

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 and resource — render one authored card standalone and see it as an image — and anchors it in the product's data model ('the same html you would put in a {kind:"card"} clip'). It is plainly distinct from preview_clip (motion) and from the composition/render tools.

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?

Explicit timing ('use this while writing a card — the fast loop for catching overflow, collisions, unresolved tokens') plus a named alternative and the condition that selects it ('to judge MOTION rather than layout ... use preview_clip'). No inference required.

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.