Skip to main content
Glama

Batch-render many .riv files/formats in one call

riv_batch_render

Renders single or globbed .riv files to png, gif, apng, webm, or sprites in sequential batches for CI pipelines, returning per-job success and error reports.

Instructions

Render a list of jobs — each a single .riv (rivPath) or a glob of .riv files (glob) — to png/gif/apng/webm/sprites, sequentially reusing the same headless Chromium page (no parallel pages). Built for CI/scripts: call this tool repeatedly from your pipeline instead of expecting a live watch mode — none is provided, since MCP's request/response model doesn't fit a background file watcher. 'defaults' holds options shared across every job; each job's own fields override them. Every job needs a format (in the job or in defaults), or that job fails. One job's failure does not stop the batch — every job (and every file a glob expands to) gets its own success/error/outPath/durationMs entry in the returned report.

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": {
      "jobs": "<jobs>"
    },
    "name": "riv_batch_render"
  }
}

Input Schema

NameRequiredDescriptionDefault
jobsYesJobs to render, in order
defaultsNoShared defaults merged under each job (job-level values win)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed14 schema fields changedv0.8.0
    • addedInput schema / properties / defaults / properties / animation / description
      Added value: +"Animation name; ignored when stateMachine is set (default: the first state machine, else the first animation)"
    • addedInput schema / properties / defaults / properties / artboard / description
      Added value: +"Artboard name (default: first artboard)"
    • changedInput schema / properties / defaults / properties / format / description
      Previous value: -"Output format for this job"New value: +"Output format: png, gif, apng, webm or sprites. Required on every job, set here or in defaults"
    • addedInput schema / properties / defaults / properties / fps / description
      Added value: +"Frames per second (default 20; 30 for webm)"
    • addedInput schema / properties / defaults / properties / height / description
      Added value: +"Output height in px (default: keeps the artboard aspect ratio)"
    • addedInput schema / properties / defaults / properties / stateMachine / description
      Added value: +"State machine name (takes precedence over animation)"
    • addedInput schema / properties / defaults / properties / width / description
      Added value: +"Output width in px (default: artboard width; 480 for gif and apng)"
    • addedInput schema / properties / jobs / items / properties / animation / description
      Added value: +"Animation name; ignored when stateMachine is set (default: the first state machine, else the first animation)"
    • addedInput schema / properties / jobs / items / properties / artboard / description
      Added value: +"Artboard name (default: first artboard)"
    • changedInput schema / properties / jobs / items / properties / format / description
      Previous value: -"Output format for this job"New value: +"Output format: png, gif, apng, webm or sprites. Required on every job, set here or in defaults"
    • addedInput schema / properties / jobs / items / properties / fps / description
      Added value: +"Frames per second (default 20; 30 for webm)"
    • addedInput schema / properties / jobs / items / properties / height / description
      Added value: +"Output height in px (default: keeps the artboard aspect ratio)"
    • addedInput schema / properties / jobs / items / properties / stateMachine / description
      Added value: +"State machine name (takes precedence over animation)"
    • addedInput schema / properties / jobs / items / properties / width / description
      Added value: +"Output width in px (default: artboard width; 480 for gif and apng)"
  2. Changed48 schema fields changedv0.6.1
    • removedInput schema / properties / defaults / properties / animation / $ref
      Removed value: -"#/properties/jobs/items/properties/animation"
    • addedInput schema / properties / defaults / properties / animation / type
      Added value: +"string"
    • removedInput schema / properties / defaults / properties / artboard / $ref
      Removed value: -"#/properties/jobs/items/properties/artboard"
    • addedInput schema / properties / defaults / properties / artboard / type
      Added value: +"string"
    • removedInput schema / properties / defaults / properties / background / $ref
      Removed value: -"#/properties/jobs/items/properties/background"
    • addedInput schema / properties / defaults / properties / background / description
      Added value: +"CSS background color"
    • addedInput schema / properties / defaults / properties / background / type
      Added value: +"string"
    • removedInput schema / properties / defaults / properties / count / $ref
      Removed value: -"#/properties/jobs/items/properties/count"
    • addedInput schema / properties / defaults / properties / count / description
      Added value: +"format=sprites: frame count (default 16)"
    • addedInput schema / properties / defaults / properties / count / exclusiveMinimum
      Added value: +0
    • addedInput schema / properties / defaults / properties / count / maximum
      Added value: +256
    • addedInput schema / properties / defaults / properties / count / type
      Added value: +"integer"
    • removedInput schema / properties / defaults / properties / duration / $ref
      Removed value: -"#/properties/jobs/items/properties/duration"
    • addedInput schema / properties / defaults / properties / duration / description
      Added value: +"format=gif/apng/webm/sprites: seconds to render (default: one animation loop, or 2s)"
    • addedInput schema / properties / defaults / properties / duration / exclusiveMinimum
      Added value: +0
    • addedInput schema / properties / defaults / properties / duration / maximum
      Added value: +30
    • addedInput schema / properties / defaults / properties / duration / type
      Added value: +"number"
    • removedInput schema / properties / defaults / properties / format / $ref
      Removed value: -"#/properties/jobs/items/properties/format"
    • addedInput schema / properties / defaults / properties / format / description
      Added value: +"Output format for this job"
    • addedInput schema / properties / defaults / properties / format / enum
      Added value: +[
      +  "png",
      +  "gif",
      +  "apng",
      +  "webm",
      +  "sprites"
      +]
    • addedInput schema / properties / defaults / properties / format / type
      Added value: +"string"
    • removedInput schema / properties / defaults / properties / fps / $ref
      Removed value: -"#/properties/jobs/items/properties/fps"
    • addedInput schema / properties / defaults / properties / fps / exclusiveMinimum
      Added value: +0
    • addedInput schema / properties / defaults / properties / fps / maximum
      Added value: +60
    • addedInput schema / properties / defaults / properties / fps / type
      Added value: +"integer"
    • removedInput schema / properties / defaults / properties / height / $ref
      Removed value: -"#/properties/jobs/items/properties/height"
    • addedInput schema / properties / defaults / properties / height / exclusiveMinimum
      Added value: +0
    • addedInput schema / properties / defaults / properties / height / maximum
      Added value: +2048
    • addedInput schema / properties / defaults / properties / height / type
      Added value: +"integer"
    • removedInput schema / properties / defaults / properties / loops / $ref
      Removed value: -"#/properties/jobs/items/properties/loops"
    • addedInput schema / properties / defaults / properties / loops / description
      Added value: +"format=apng: loop count, 0=infinite (default 0)"
    • addedInput schema / properties / defaults / properties / loops / minimum
      Added value: +0
    • addedInput schema / properties / defaults / properties / loops / type
      Added value: +"integer"
    • removedInput schema / properties / defaults / properties / outDir / $ref
      Removed value: -"#/properties/jobs/items/properties/outDir"
    • addedInput schema / properties / defaults / properties / outDir / description
      Added value: +"Output directory (default: alongside the source .riv)"
    • addedInput schema / properties / defaults / properties / outDir / type
      Added value: +"string"
    • removedInput schema / properties / defaults / properties / stateMachine / $ref
      Removed value: -"#/properties/jobs/items/properties/stateMachine"
    • addedInput schema / properties / defaults / properties / stateMachine / type
      Added value: +"string"
    • removedInput schema / properties / defaults / properties / time / $ref
      Removed value: -"#/properties/jobs/items/properties/time"
    • addedInput schema / properties / defaults / properties / time / description
      Added value: +"format=png: seconds to advance before capture (default 0)"
    • addedInput schema / properties / defaults / properties / time / type
      Added value: +"number"
    • removedInput schema / properties / defaults / properties / transparent / $ref
      Removed value: -"#/properties/jobs/items/properties/transparent"
    • addedInput schema / properties / defaults / properties / transparent / description
      Added value: +"format=apng: render on a transparent background (default true)"
    • addedInput schema / properties / defaults / properties / transparent / type
      Added value: +"boolean"
    • removedInput schema / properties / defaults / properties / width / $ref
      Removed value: -"#/properties/jobs/items/properties/width"
    • addedInput schema / properties / defaults / properties / width / exclusiveMinimum
      Added value: +0
    • addedInput schema / properties / defaults / properties / width / maximum
      Added value: +2048
    • addedInput schema / properties / defaults / properties / width / type
      Added value: +"integer"
  3. First observedv0.5.0

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations provided, the description carries the full behavioral burden and does so well: sequential rendering on one headless Chromium page, no parallel pages, no watch mode, per-job failure isolation, and report entries for every job/file. These are exactly the operational traits an agent needs before invoking it.

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?

The description is dense but well front-loaded, starting with what the tool renders before moving to execution and failure semantics. Most sentences earn their place, though the long paragraph could be slightly easier to scan.

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

Completeness5/5

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

For a complex nested-job tool with no output schema, the description is complete enough: it explains batching, defaults merging, format requirements, failure behavior, and the shape of the returned report entries. An agent has what it needs to call the tool correctly.

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 schema already documents the parameters thoroughly. The description adds meaningful semantics beyond it: defaults are merged under each job with job-level values winning, and every job needs a format either in the job or in defaults.

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?

The description states a specific verb and resource: batch-render a list of .riv jobs to png/gif/apng/webm/sprites. It clearly distinguishes this batch tool from single-file rendering siblings by emphasizing lists, globs, and one-call batching.

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?

It gives a clear usage context: built for CI/scripts and meant to be called repeatedly, with no live watch mode. It does not explicitly name single-render siblings as alternatives, but the batch-vs-single distinction is implicit and usable.

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