Skip to main content
Glama

Render an animation to a sprite sheet PNG

riv_render_sprites

Render N evenly-spaced frames from a .riv animation or state machine into a grid sprite sheet PNG, with matching JSON metadata for frame layout and playback.

Instructions

Render N evenly-spaced frames of a .riv animation/state machine into a single grid sprite sheet PNG (columns = ceil(sqrt(N))). Writes the PNG plus a JSON metadata file (cellW/cellH/cols/rows/count/fps) alongside.

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": {
      "path": "<path>"
    },
    "name": "riv_render_sprites"
  }
}

Input Schema

NameRequiredDescriptionDefault
fpsNoMetadata playback fps (default: count/duration)
outNoOutput PNG path (default: alongside the .riv); metadata is written next to it with a .json extension
pathYesPath to the .riv file
countNoNumber of frames (default 16)
widthNoOutput width in px (default: artboard width)
heightNoOutput height in px (default: keeps the artboard aspect ratio)
artboardNoArtboard name (default: first artboard)
durationNoSeconds spanned by the frames (default: one animation loop, or 2s)
animationNoAnimation name; ignored when stateMachine is set (default: the first state machine, else the first animation)
backgroundNoCSS background color (default: transparent)
stateMachineNoState machine name (takes precedence over animation)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv0.8.0
    • addedInput schema / properties / animation / description
      Added value: +"Animation name; ignored when stateMachine is set (default: the first state machine, else the first animation)"
    • addedInput schema / properties / artboard / description
      Added value: +"Artboard name (default: first artboard)"
    • addedInput schema / properties / background / description
      Added value: +"CSS background color (default: transparent)"
    • addedInput schema / properties / height / description
      Added value: +"Output height in px (default: keeps the artboard aspect ratio)"
    • addedInput schema / properties / stateMachine / description
      Added value: +"State machine name (takes precedence over animation)"
    • addedInput schema / properties / width / description
      Added value: +"Output width in px (default: artboard width)"
  2. First observedv0.5.0

TDQS

A3.7/5.0
Behavior3/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 disclose the key side effect: it writes a PNG plus a JSON metadata file next to it, and even names the metadata fields. However, it never states overwrite behavior for existing files, failure modes (bad path, missing artboard/state machine), or whether the operation is idempotent — gaps that matter for a write-to-disk tool with zero annotation 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?

Two compact sentences with the artifact and layout rule front-loaded, and the side-effect file is noted immediately after. Dense but every clause carries information; only the parenthetical formula mildly interrupts the flow.

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 an 11-parameter, annotation-free tool with no output schema, the description covers the essentials: what is produced, where it lands, and the default grid behavior, while the schema fully documents each parameter. The only meaningful omission is write-side behavior (overwriting existing output) and error conditions.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so baseline is 3 and the schema already documents every parameter including defaults and bounds. The description adds only the grid formula and confirms the JSON metadata contents (cellW/cellH/cols/rows/count/fps), which is marginal value on top of a fully documented 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 (render), a precise resource (grid sprite sheet PNG), and the exact output composition (N evenly-spaced frames, grid laid out by ceil(sqrt(N))). This clearly distinguishes it from riv_render_frame, riv_render_gif, riv_render_apng and riv_render_video, which produce different artifacts.

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

Usage Guidelines3/5

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

The output format implies when to use it (you want a sprite sheet rather than a GIF/APNG/video), but no sibling is ever named and there is no explicit when/when-not guidance. An agent must infer the choice from the artifact description alone, which is implied usage rather than stated routing.

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