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
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | For URL action | |
| file | No | Target file (fileKey, id or name). Defaults to the most recently active file. | |
| mode | No | ||
| action | No | Required unless mode is 'clear' or extraActions is given | |
| device | No | ON_KEY_DOWN device (default KEYBOARD) | |
| nodeId | Yes | Node that receives the interaction (hotspot) | |
| delayMs | No | MOUSE_ENTER/LEAVE/UP/DOWN delay in ms (default 0) | |
| trigger | No | Default ON_CLICK | |
| keyCodes | No | ON_KEY_DOWN key codes | |
| timeoutMs | No | AFTER_TIMEOUT delay in ms (default 800) | |
| transition | No | ||
| extraActions | No | Raw Plugin API Action objects appended after `action` | |
| openInNewTab | No | For URL action | |
| destinationId | No | Target node for NAVIGATE/OVERLAY/SWAP/SCROLL_TO/CHANGE_TO | |
| resetScrollPosition | No | ||
| overlayRelativePosition | No | OVERLAY manual position |