get_bound_variables
Retrieve variable bindings for Figma design nodes to identify which variables control fills, strokes, and other properties.
Instructions
Get all variable bindings for a node. Shows which variables are bound to fills, strokes, and other properties.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nodeId | Yes | The ID of the node to inspect |
Implementation Reference
- src/talk_to_figma_mcp/tools/modification-tools.ts:415-442 (registration)Registers the MCP tool 'get_bound_variables' using server.tool(). Includes schema validation with Zod and the handler function that sends a command to Figma and formats the response."get_bound_variables", "Get all variable bindings for a node. Shows which variables are bound to fills, strokes, and other properties.", { nodeId: z.string().describe("The ID of the node to inspect") }, async ({ nodeId }) => { try { const result = await sendCommandToFigma("get_bound_variables", { nodeId }); return { content: [ { type: "text", text: JSON.stringify(result, null, 2) } ] }; } catch (error) { return { content: [ { type: "text", text: `Error getting bound variables: ${error instanceof Error ? error.message : String(error)}` } ] }; } } );
- The handler function for the 'get_bound_variables' tool. It calls sendCommandToFigma to retrieve bound variables for the given nodeId and returns the result as formatted JSON text, or an error message.async ({ nodeId }) => { try { const result = await sendCommandToFigma("get_bound_variables", { nodeId }); return { content: [ { type: "text", text: JSON.stringify(result, null, 2) } ] }; } catch (error) { return { content: [ { type: "text", text: `Error getting bound variables: ${error instanceof Error ? error.message : String(error)}` } ] }; } }
- Input schema for the 'get_bound_variables' tool using Zod, requiring a nodeId string.{ nodeId: z.string().describe("The ID of the node to inspect") },