get_reactions
Retrieve Figma prototyping reactions from specified nodes to analyze user interactions and prepare data for creating connector lines between design elements.
Instructions
Get Figma Prototyping Reactions from multiple nodes. CRITICAL: The output MUST be processed using the 'reaction_to_connector_strategy' prompt IMMEDIATELY to generate parameters for connector lines via the 'create_connections' tool.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nodeIds | Yes | Array of node IDs to get reactions from |
Implementation Reference
- The main handler function for the 'get_reactions' MCP tool. It calls sendCommandToFigma to retrieve prototyping reactions from specified node IDs in Figma, returns the JSON result as text content, includes an important instruction for next steps, and sets a follow-up prompt 'reaction_to_connector_strategy'.async ({ nodeIds }) => { try { const result = await sendCommandToFigma("get_reactions", { nodeIds }); return { content: [ { type: "text", text: JSON.stringify(result) }, { type: "text", text: "IMPORTANT: You MUST now use the reaction data above and follow the `reaction_to_connector_strategy` prompt to prepare the parameters for the `create_connections` tool call. This is a required next step." } ], followUp: { type: "prompt", prompt: "reaction_to_connector_strategy", }, }; } catch (error) { return { content: [ { type: "text", text: `Error getting reactions: ${error instanceof Error ? error.message : String(error) }`, }, ], }; } }
- The input schema for the 'get_reactions' tool, defining 'nodeIds' as an array of strings using Zod validation.nodeIds: z.array(z.string()).describe("Array of node IDs to get reactions from"), },
- src/talk_to_figma_mcp/server.ts:2339-2376 (registration)The registration of the 'get_reactions' tool on the MCP server using server.tool(), including name, description, schema, and handler.server.tool( "get_reactions", "Get Figma Prototyping Reactions from multiple nodes. CRITICAL: The output MUST be processed using the 'reaction_to_connector_strategy' prompt IMMEDIATELY to generate parameters for connector lines via the 'create_connections' tool.", { nodeIds: z.array(z.string()).describe("Array of node IDs to get reactions from"), }, async ({ nodeIds }) => { try { const result = await sendCommandToFigma("get_reactions", { nodeIds }); return { content: [ { type: "text", text: JSON.stringify(result) }, { type: "text", text: "IMPORTANT: You MUST now use the reaction data above and follow the `reaction_to_connector_strategy` prompt to prepare the parameters for the `create_connections` tool call. This is a required next step." } ], followUp: { type: "prompt", prompt: "reaction_to_connector_strategy", }, }; } catch (error) { return { content: [ { type: "text", text: `Error getting reactions: ${error instanceof Error ? error.message : String(error) }`, }, ], }; } } );