Skip to main content
Glama

Generate integration code

riv_generate_code

Generates ready-to-use integration code for a .riv file in React, Vue, Svelte, plain JS, or Flutter, using the animation's real artboard, state machine, and input names.

Instructions

Generate ready-to-use integration code (React/Vue/Svelte/plain JS/Flutter) for a .riv file, using its real artboard, state machine and input names.

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>",
      "framework": "<framework>"
    },
    "name": "riv_generate_code"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesPath to the .riv file
frameworkYesTarget: react, js (plain JavaScript), vue, svelte or flutter

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.8.0
    • addedInput schema / properties / framework / description
      Added value: +"Target: react, js (plain JavaScript), vue, svelte or flutter"
  2. First observedv0.5.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It does disclose one meaningful behavioral trait — the generated code uses the file's real artboard, state machine and input names rather than placeholders. However it never says whether code is returned inline or written to disk, whether it overwrites anything, or what permissions are needed.

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?

A single front-loaded sentence with the verb, output type, and resource; nothing is wasted and the framework list is compact.

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?

Both required parameters are well covered by the schema, but with no output schema and no annotations, the description should clarify the return shape (code string vs. written file, where it lands). That missing piece leaves an agent unsure what to expect after the call.

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 both `path` and `framework` (with its enum) are already fully documented in the schema. The description adds only the framing that the file's real names drive generation; it adds no syntax or format detail beyond the schema baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Specific verb+resource: 'Generate ready-to-use integration code ... for a .riv file', with the supported frameworks enumerated. It is clearly distinguishable from render/inspect/edit siblings, though it does not explicitly name what it is not.

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?

Usage is only implied by the verb and resource — an agent can infer this is what you call when you need integration code for a .riv file. There is no explicit when-to-use/when-not guidance, no mention of prerequisites such as the file existing or being inspected first, and no routing to siblings like riv_inspect.

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