Skip to main content
Glama

Render an animation to APNG

riv_render_apng

Render a .riv animation or state machine to an animated PNG with 24-bit color and full alpha transparency, producing files that animate in GitHub READMEs like a regular image.

Instructions

Render a .riv animation (or state machine playback) to an animated PNG (APNG). Unlike GIF this supports 24-bit color plus full alpha transparency, and GitHub READMEs animate it like a regular image. Frames are rendered with a transparent background by default.

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

Input Schema

NameRequiredDescriptionDefault
fpsNoFrames per second (default 20)
outNoOutput path, .apng or .png (default: <name>.apng alongside the .riv)
pathYesPath to the .riv file
loopsNoLoop count (0 = infinite, default 0)
widthNoOutput width (default 480)
heightNoOutput height in px (default: keeps the artboard aspect ratio)
artboardNoArtboard name (default: first artboard)
durationNoSeconds to render (default 2)
animationNoAnimation name (default: first state machine or animation)
backgroundNoCSS background color when transparent=false (default #ffffff)
transparentNoRender on a transparent background to keep APNG alpha (default true). Set false to composite onto 'background'
stateMachineNoState machine name (takes precedence over animation)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.8.0
    • 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)"
  2. First observedv0.5.0

TDQS

A4/5.0
Behavior3/5

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

With no annotations, the description carries the disclosure burden; it usefully notes frames default to a transparent background and explains the transparency/background relationship. However it omits write-side behavior: that it writes a file to disk, overwrite semantics, and any setup/dependency requirements, which matters for a render-and-save tool.

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 tight sentences with zero filler, leading with what it does and the format's key differentiator before the background note. Every clause earns its place.

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 12-parameter render tool with no output schema, the description adequately conveys the core capability and a key default. It could be slightly fuller on output file placement and state-machine precedence, but nothing critical for invoking it is missing.

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 coverage is 100%, so all 12 parameters including defaults are already documented in the schema. The description only reinforces the transparent-background default and adds no format or interpretation detail beyond the structured fields, so baseline 3 is appropriate.

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) and resource (.riv animation or state machine) to a precise output format (APNG). It explicitly contrasts with GIF, letting an agent distinguish it from riv_render_gif without opening a schema.

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

Usage Guidelines4/5

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

Explains the selection rationale versus GIF (24-bit color, alpha transparency, GitHub README animation) which gives clear context for when to choose this format. It does not name other siblings like riv_render_video or state explicit when-not conditions, so it stops short of full routing guidance.

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