Skip to main content
Glama
yhoyoex

OpenCode Figma MCP

by yhoyoex

add_interaction

Add a prototype interaction to a Figma node by setting its trigger, action, and optional transition; appends to existing reactions unless replace is true.

Instructions

Add a prototype interaction (trigger + action) to a node. NAVIGATE/SWAP/OVERLAY need a top-level frame on the same page as destination, SCROLL_TO a node inside the same top-level frame, CHANGE_TO a variant of the same component set (source must be an instance or inside a variant). Directional transitions (MOVE_IN, MOVE_OUT, PUSH, SLIDE_IN, SLIDE_OUT) require a direction. Appends to existing reactions unless replace is true.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNoURL to open, required for the URL action
actionNoAction type (default: NAVIGATE)
nodeIdYesID of the node that receives the interaction
replaceNoReplace all existing reactions instead of appending (default: false)
timeoutNoDelay in SECONDS (e.g. 2 = 2s), required for AFTER_TIMEOUT; converted to milliseconds for Figma
triggerNoTrigger type (default: ON_CLICK)
transitionNoTransition for node actions (default: INSTANT)
openInNewTabNoOpen URL in a new tab (URL action only, default true)
destinationIdNoDestination node ID, required for NAVIGATE, OVERLAY, SWAP, SCROLL_TO and CHANGE_TO
preserveScrollPositionNoKeep the destination's scroll position (node actions only)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.1

TDQS

A4.4/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 reasonably well: it discloses the append-vs-replace behavior ("Appends to existing reactions unless replace is true") and structural preconditions for destinations. It omits error behavior, permission needs, and what the tool returns, so it is not exhaustive.

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?

Purpose is front-loaded in the first clause, followed by tightly packed conditional rules, each earning its place. No filler sentences, no redundancy despite the density.

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 10-parameter tool with a nested transition object and no output schema or annotations, the description covers the key calling constraints (action preconditions, directional transitions, append behavior). Remaining gaps are error/return behavior, which is a minor omission for an interaction-adder.

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 description coverage is 100%, so the baseline is 3, but the description adds genuine cross-parameter semantics the schema cannot: which actions require destinationId, that directional transitions require a direction, and the timeout-for-AFTER_TIMEOUT relationship. It adds relational meaning beyond per-field docs.

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+resource ("Add a prototype interaction (trigger + action) to a node"), which precisely identifies the operation. This distinguishes it from siblings like set_reactions, get_reactions, and remove_interactions without ambiguity.

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 clear conditional context per action type: which actions need a top-level frame, SCROLL_TO's frame constraint, CHANGE_TO's component-set requirement, and direction requirements for directional transitions. It doesn't explicitly name alternative siblings (set_reactions) or when-not-to-use, so it stops short of a 5.

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