Skip to main content
Glama

Preview SVG

preview_animation_frame

Render SVG content or a stored animation artifact to a PNG so the AI can visually inspect the output and iterate. Pass an artifact id to re-preview at a new width without resending SVG.

Instructions

Render SVG content to a PNG image so the AI can visually inspect the output.

When to use:

  • render_animation already returns a preview image by default; call this tool to re-preview a stored artifact at a different width, or to preview SVG that did not come from render_animation

  • Stop iterating when the visual result matches the intent

Input: pass EITHER artifact (id from render_animation, e.g. "art-1" — preferred, no SVG resend) OR content (raw SVG string).

Behavior:

  • Returns a PNG image (base64) rendered from the SVG

  • Background is transparent by default

  • CSS animations and SMIL are rendered as a static snapshot (t=0) — motion is not captured

Width:

  • Omit width to use the SVG's own declared width/viewBox

  • Pass width to scale the output (useful for small SVGs that need a larger preview)

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "preview_animation_frame"
  }
}

Input Schema

NameRequiredDescriptionDefault
widthNoRender width in pixels; defaults to SVG's own declared width
formatNoContent format; auto-detected from content if omitted
contentNoSVG string to render as PNG. Only needed when no artifact id exists.
artifactNoArtifact id returned by render_animation (e.g. "art-1"). Preferred over content.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.0

TDQS

A4.5/5.0
Behavior4/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 most of it: it discloses the return type (base64 PNG), the default transparent background, and the important limitation that CSS/SMIL animations are rendered as a static t=0 snapshot so motion is not captured. It does not mention error behavior or whether the call has any side effects, which keeps it just short of full coverage.

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 one-line purpose followed by labeled blocks (When to use / Input / Behavior / Width) that make scanning easy. The markdown headings add a little overhead for a short tool, but every sentence conveys actionable information rather than filler.

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 four-parameter, all-optional render tool with no annotations and no output schema, the definition covers input selection, output form, background default, animation limitation, and width behavior. The only omission is the format parameter and any error/failure guidance, 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?

Schema coverage is 100%, so the baseline is 3; the description goes further by explaining the either/or relationship between artifact and content and why artifact is preferred ('no SVG resend'), and by explaining the purpose of width (scaling small SVGs up). It never mentions the format parameter, which is left entirely to 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 and resource ('Render SVG content to a PNG image') plus the intent ('so the AI can visually inspect the output'). It explicitly distinguishes itself from render_animation, which already returns a preview, so an agent can tell the two apart without opening either schema.

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?

A dedicated 'When to use' block names the alternative (render_animation) and the exact conditions that select this tool: re-previewing a stored artifact at a different width, or previewing SVG not produced by render_animation. It also gives a stopping condition ('stop iterating when the visual result matches the intent') and routes between artifact vs content input.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.