Skip to main content
Glama

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
NameRequiredDescriptionDefault
nodeIdYesThe ID of the node to inspect

Implementation Reference

  • 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")
    },

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/agenisea/cc-fig-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server