Skip to main content
Glama

Render an animation to a WebM video

riv_render_video

Render .riv animations or state machines to WebM video with configurable size, frame rate, and duration.

Instructions

Render a .riv animation (or state machine) to a real-time WebM video using canvas.captureStream() + MediaRecorder (VP9, falls back to VP8/generic webm). Default duration is one loop of the animation (2s for a bare state machine or when the animation's length can't be determined).

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

Input Schema

NameRequiredDescriptionDefault
fpsNocaptureStream() frame rate (default 30)
outNoOutput .webm path (default: alongside the .riv)
pathYesPath to the .riv file
widthNoOutput width in px (default: artboard width)
heightNoOutput height in px (default: keeps the artboard aspect ratio)
artboardNoArtboard name (default: first artboard)
durationNoSeconds to record (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. Changed5 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 / 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.9/5.0
Behavior4/5

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

With no annotations, the description carries the whole burden and does add real behavior: the captureStream/MediaRecorder mechanism, VP9 with VP8/generic-webm fallback, and the duration fallback rule (2s for bare state machines or undeterminable length). It stops short of stating whether rendering requires a headless browser, whether existing output files are overwritten, or roughly how long the operation takes.

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

Conciseness5/5

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

Two dense sentences, front-loaded with the core action and output format, then the implementation and defaulting rules. No filler and nothing that could be cut without losing information.

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

Completeness3/5

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

For a 10-parameter, annotation-free tool with no output schema, the description covers the mechanism and key defaults but says nothing about the return value (e.g., whether it returns the written path), the cost/latency of rendering, or any environment prerequisites. Adequate but noticeably incomplete for this complexity.

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 the baseline is 3. The description only re-states defaults already documented per-parameter (duration, animation vs. stateMachine precedence) rather than adding syntax, formats, or constraints beyond 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 ('Render') plus the resource (a .riv animation or state machine) and the exact output artifact (real-time WebM video), which cleanly separates it from riv_render_gif, riv_render_apng, riv_render_frame and riv_render_sprites without needing to name them.

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 WebM output format implies when to choose this over the GIF/APNG/frame siblings, but no alternative is named and no conditions or exclusions are given. The only explicit guidance is about defaults (duration, animation vs. stateMachine precedence), not about tool selection.

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