Skip to main content
Glama

set_reaction

Add, replace, or clear prototype interactions on Figma Design nodes; use replace, append, or clear modes to manage trigger reactions and actions.

Instructions

Add, replace or clear a prototype interaction on a node (Figma Design only). mode 'replace' (default) swaps out existing reactions with the same trigger; 'append' adds the action to the existing reaction with that trigger (multi-action) or creates one; 'clear' removes reactions with trigger (or all reactions when trigger is omitted). Actions: NAVIGATE, OVERLAY, SWAP, SCROLL_TO, CHANGE_TO (need destinationId; CHANGE_TO targets a sibling variant), BACK, CLOSE, URL (needs url). Transition omitted = instant. Use extraActions for raw Plugin API Action objects (e.g. SET_VARIABLE, CONDITIONAL). Returns the node's resulting reactions.

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": {
      "nodeId": "<nodeId>"
    },
    "name": "set_reaction"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNoFor URL action
fileNoTarget file (fileKey, id or name). Defaults to the most recently active file.
modeNo
actionNoRequired unless mode is 'clear' or extraActions is given
deviceNoON_KEY_DOWN device (default KEYBOARD)
nodeIdYesNode that receives the interaction (hotspot)
delayMsNoMOUSE_ENTER/LEAVE/UP/DOWN delay in ms (default 0)
triggerNoDefault ON_CLICK
keyCodesNoON_KEY_DOWN key codes
timeoutMsNoAFTER_TIMEOUT delay in ms (default 800)
transitionNo
extraActionsNoRaw Plugin API Action objects appended after `action`
openInNewTabNoFor URL action
destinationIdNoTarget node for NAVIGATE/OVERLAY/SWAP/SCROLL_TO/CHANGE_TO
resetScrollPositionNo
overlayRelativePositionNoOVERLAY manual position

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/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 that 'clear' removes reactions (destructive), that omitting trigger widens the deletion to all reactions, that the tool returns the resulting reactions, and that it only works in Figma Design. It does not mention permissions, whether changes are undoable, or how conflicts between replace and append resolve on error.

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-loaded with the verb and scope, then mode semantics, then action requirements, then the return value — a sensible priority order with no filler sentences. The middle action/destination sentence is dense and could be split for scanability, but no clause 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 16-parameter mutation tool with no annotations and no output schema, the description covers the high-risk areas: destructive clear semantics, the mode decision, action-to-required-parameter mapping, and the return value. Remaining gaps (timing parameters, device/keyCodes, overlay position) are adequately documented in the schema itself.

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 already 81%, so the baseline is 3, and the description's contribution is mostly a restatement of schema-level facts: which actions need destinationId, that CHANGE_TO targets a sibling variant, that URL needs url, that an omitted transition means instant. The CHANGE_TO variant constraint and the extraActions raw-object hint add genuine meaning, but the rest duplicates what the schema's descriptions already state.

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 opening sentence names a specific verb set (add, replace, clear), the exact resource (a prototype interaction / reaction on a node), and a platform scope constraint (Figma Design only). No sibling in the catalog touches prototype reactions, so an agent can route here 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?

The description spells out the three modes and the exact condition each one applies to (replace = swap same-trigger reactions, append = multi-action, clear = remove by trigger or all), which is effectively when-to-use guidance at the mode level. It also signals the escape hatch (extraActions for raw Action objects). It stops short of stating exclusions, e.g. that this is not for non-prototype properties or what to do if the node isn't in a prototype.

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