Skip to main content
Glama

Edit an existing .riv file

riv_edit

Modify existing .riv files losslessly: set properties, edit text runs, delete objects with subtree/reference remapping, and change animation keyframes, then render a preview of the result.

Instructions

Modify an existing .riv (lossless roundtrip): set any property, change named text runs, delete objects (with automatic subtree + reference remapping), or edit keyframes on an existing animation (op=setKeyframes). Use riv_dump to find object indices/names. Renders a preview of the result. setKeyframes: target an animated object via index/name(+type), give 'animation' (LinearAnimation name) and 'property' (x/y/rotation/scaleX/scaleY/opacity/width/height — rotation in degrees), then 'keyframes' (array of {frame,value,easing}). 'mode': replace (default, swaps the whole track) | add (appends keyframes, creating the track if absent) | remove (deletes keyframes matching the given frame numbers; keyframes[].value/easing are ignored).

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>",
      "edits": "<edits>"
    },
    "name": "riv_edit"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesSource .riv path
editsYesEdit operations, applied in order
outPathNoOutput path (default: overwrite source)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv0.8.0
    • addedInput schema / properties / edits / description
      Added value: +"Edit operations, applied in order"
    • addedInput schema / properties / edits / items / properties / keyframes / items / properties / easing / description
      Added value: +"Easing for the segment from this keyframe to the next (default linear; hold = step)"
    • addedInput schema / properties / edits / items / properties / keyframes / items / properties / frame / description
      Added value: +"Frame number within the animation"
    • addedInput schema / properties / edits / items / properties / keyframes / items / properties / value / description
      Added value: +"Value at this frame (required unless mode=remove)"
    • addedInput schema / properties / edits / items / properties / op / description
      Added value: +"set: properties; setText: text run; delete: object; setKeyframes: animation track"
  2. First observedv0.5.0

TDQS

A4.3/5.0
Behavior4/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 much of it: it discloses that deletes trigger automatic subtree and reference remapping, that a preview is rendered, and that edits apply in order. It leaves gaps around failure behavior (partial application on error), overwrite risk confirmed only via the schema's outPath default, and what the preview actually returns.

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?

Front-loads the operation inventory in sentence one, then spends the second paragraph exclusively on the most complex op (setKeyframes), which is the right allocation of space. It is dense with long parentheticals and could be split into a short bulleted op list, but no sentence is wasted.

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 nested, multi-op mutation tool with no annotations and no output schema, the description covers the operation taxonomy and the hardest sub-mode in usable depth. Remaining gaps are error/atomicity semantics and what the rendered preview contains — meaningful but secondary for a call to succeed.

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 baseline is 3, but the description adds genuine semantics: rotation is in degrees, mode=replace swaps the whole track vs add appends/creates, and remove deletes by frame number while ignoring value/easing. The schema's own enum descriptions for mode and keyframes are terse, so this materially improves correct invocation.

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?

Opens with a specific verb+resource ('Modify an existing .riv') and immediately enumerates the four supported operations (set, setText, delete, setKeyframes), which maps directly onto the op enum. It is clearly distinguishable from riv_create (new file) and riv_dump (read-only inspection), which it explicitly references as the companion lookup tool.

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?

Gives a concrete prerequisite and routing instruction: use riv_dump to find object indices/names before editing, and notes the roundtrip is lossless. It does not state explicit when-not conditions (e.g. when to prefer riv_create vs this, or when to use riv_optimize afterwards), so it stops short of full alternative routing.

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