Skip to main content
Glama

Optimize a .riv file (lossless)

riv_optimize

Shrink a .riv file without altering its visuals by removing unreferenced data and thinning redundant linear keyframes. Preview the plan with dry-run mode before applying changes.

Instructions

Shrink a .riv without changing its visual output: remove unreferenced objects (dangling easing interpolators, fired-events nothing points to, empty keyframe tracks left over from prior edits) and thin redundant keyframes on strictly-linear-interpolation runs within a tolerance. Only runs where every segment is linear are touched — any run touching hold/cubic easing is left alone, so no easing gets shifted (see keyed_property.cpp semantics: a KeyFrame's interpolationType applies to the segment going INTO the next frame). Colors and id-keyframes (soloActive) are never thinned, only numeric (KeyFrameDouble) tracks. All steps are opt-in booleans (default: all on) and idempotent/safe to run repeatedly. Use dryRun=true to see the removal/thinning plan without writing anything. Run riv_lint afterwards if in doubt.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesSource .riv path
dryRunNoReport the plan only; don't write anything (default false)
outPathNoOutput path (default: overwrite source)
toleranceNoThinning tolerance as a ratio of each track's own value range (default 0.01 = 1%, conservative)
thinKeyframesNoDouglas-Peucker thin redundant keyframes on linear-only runs (default true)
removeUnreferencedNoRemove unreferenced interpolators/events/empty tracks (default true)
Behavior5/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 so comprehensively. It discloses what gets removed (dangling easing interpolators, fired-events, empty tracks), the strict linear-only constraint for thinning, the exclusion of color/id keyframes, opt-in flags, idempotency, and the dry-run behavior. This is rich, unambiguous behavioral disclosure.

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?

The description is dense but every sentence earns its place. It front-loads the core purpose, then interleaves constraints, exceptions, and safety guidance with no redundancy or fluff. The structure flows logically from what → safety → usage tips.

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?

Given the tool's complexity and lack of output schema, the description covers all necessary context: specific operations, algorithmic caveats (linear-only, no easing shift), parameter semantics, idempotency, dry-run workflow, and follow-up validation. It is complete for an agent to invoke correctly and understand consequences.

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%, providing a baseline of 3. The description adds beyond schema by clarifying that thinning applies only to numeric tracks (KeyFrameDouble) and never to colors or soloActive keyframes, and by tying each boolean to the described removal/thinning steps. This adds meaningful parameter meaning.

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 opens with a specific verb and resource: 'Shrink a .riv without changing its visual output', and enumerates distinct actions (remove unreferenced objects, thin redundant keyframes). It clearly differentiates from siblings like riv_lint and riv_edit by focusing on lossless optimization rather than validation or manual editing.

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?

The description provides strong usage context: idempotent/safe to run repeatedly, dryRun for planning, and a post-step (run riv_lint afterwards if in doubt). It does not explicitly name alternatives or state when not to use, but the purpose alone makes the intended scenario clear.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ODU33104/rive-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server