Skip to main content
Glama

Turn a detected UI screenshot into an animated .riv

riv_ui_prototype

Turns elements detected from a screenshot, SVG, or Figma frame into a working .riv: assigns each a role, then adds role-based entrance animations and hover/press states to buttons and cards.

Instructions

Take the elements from riv_ui_detect, assign each one a role, and get back a working .riv: every element becomes a shape or an image asset, each gets an entrance appropriate to its role, and buttons and cards get hover and press states. Roles: background, nav, header, card, panel, button, fab, text, icon, image, chart, list-item, badge, divider, avatar, input. Elements you leave unassigned animate as a generic panel. Pass exactly one of imagePath, svgPath or figmaUrl, the same one you gave riv_ui_detect. If you changed minArea or maxElements there, pass the same values here so the ids match. With svgPath no screenshot is embedded, every element stays editable, and the file reproduces the SVG; its becomes real Rive text you can re-type at runtime, and its embedded data becomes an image asset. figmaUrl fetches the same thing straight from Figma, and needs FIGMA_TOKEN.

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": {
      "outPath": "<outPath>",
      "roles": "<roles>"
    },
    "name": "riv_ui_prototype"
  }
}

Input Schema

NameRequiredDescriptionDefault
fontsNoFonts for the SVG's <text>. svgPath only. Without a match the bundled Inter is used and a warning says so; a run whose glyphs the font lacks (CJK, say) is baked as a picture rather than embedded as tofu
rolesYesRole for each element. Ids you omit fall back to a generic panel.
ambientNoGive roles with an idle motion a looping ambient animation (default true)
minAreaNoMust match the riv_ui_detect call. imagePath only (default 576)
outPathYesWhere to write the .riv
staggerNoDelay between elements entering, in milliseconds
svgPathNoThe same SVG you passed to riv_ui_detect (instead of imagePath)
figmaUrlNoThe same Figma link you passed to riv_ui_detect. Off unless FIGMA_TOKEN is set in the server's environment. The frame is fetched again, so a design that changed in between can move the ids
imagePathNoThe same screenshot you passed to riv_ui_detect
entranceMsNoHow long the whole entrance takes, in milliseconds
maxElementsNoMust match the riv_ui_detect call (default 120, or 300 for svgPath)
interactionsNoAdd hover and press states where the role has them (default true)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.8.0
    • changedInput schema / properties / maxElements / description
      Previous value: -"Must match the riv_ui_detect call (default 120)"New value: +"Must match the riv_ui_detect call (default 120, or 300 for svgPath)"
    • changedInput schema / properties / minArea / description
      Previous value: -"Must match the riv_ui_detect call (default 576)"New value: +"Must match the riv_ui_detect call. imagePath only (default 576)"
  2. Addedv0.6.1

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 behavioral burden and does well: it explains role-driven shape/image creation, entrance animations, hover/press states, fallback behavior for unassigned elements, and how svgPath preserves editable text/images. It stops short of covering overwrite behavior for outPath, failure modes, or what the call returns beyond producing a .riv.

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 front-loaded with the core action and workflow, then moves to roles, path constraints, and svgPath/figmaUrl behavior. It is dense but appropriately sized for a complex 12-parameter tool, with little wasted text, though the long role list and packed sentences reduce readability slightly.

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 complex mutation tool with no annotations and no output schema, the description is largely complete: it covers purpose, required prior-step alignment, role mapping, input exclusivity, svgPath semantics, and FIGMA_TOKEN requirements. It could be stronger by stating the actual return value or outPath overwrite behavior, but the essential invocation context is present.

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 each parameter, but the description adds important semantics beyond it: exactly one of imagePath, svgPath, or figmaUrl must be passed, the same one used in riv_ui_detect, and minArea/maxElements must match across calls. It also explains role assignment and the generic-panel fallback, though it does not clarify every behavioral parameter such as stagger, ambient, or entranceMs.

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: taking elements from riv_ui_detect, assigning roles, and producing an animated .riv file. It clearly distinguishes this prototyping step from the upstream detection call and from generic creation/import siblings by naming the source tool and the resulting artifact.

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 explains the intended workflow after riv_ui_detect, requiring the same imagePath/svgPath/figmaUrl input and matching minArea/maxElements values so ids line up. It provides clear context and prerequisites but does not explicitly name when to prefer alternatives such as riv_import_svg or riv_create.

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