Skip to main content
Glama
yhc984

Talk to Figma MCP

by yhc984

get_node_info

Retrieve detailed information about specific design elements in Figma by providing their node ID. This tool enables users to access comprehensive data about individual components within their Figma designs.

Instructions

Get detailed information about a specific node in Figma

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodeIdYesThe ID of the node to get information about

Implementation Reference

  • Core implementation of get_node_info: Retrieves a Figma node by ID using figma.getNodeByIdAsync and constructs a detailed info object with properties like position, size, fills, strokes, children, and type-specific details.
    async function getNodeInfo(nodeId) {
      const node = await figma.getNodeByIdAsync(nodeId);
    
      if (!node) {
        throw new Error(`Node not found with ID: ${nodeId}`);
      }
    
      // Base node information
      const nodeInfo = {
        id: node.id,
        name: node.name,
        type: node.type,
        visible: node.visible,
      };
    
      // Add position and size for SceneNode
      if ("x" in node && "y" in node) {
        nodeInfo.x = node.x;
        nodeInfo.y = node.y;
      }
    
      if ("width" in node && "height" in node) {
        nodeInfo.width = node.width;
        nodeInfo.height = node.height;
      }
    
      // Add fills for nodes with fills
      if ("fills" in node) {
        nodeInfo.fills = node.fills;
      }
    
      // Add strokes for nodes with strokes
      if ("strokes" in node) {
        nodeInfo.strokes = node.strokes;
        if ("strokeWeight" in node) {
          nodeInfo.strokeWeight = node.strokeWeight;
        }
      }
    
      // Add children for parent nodes
      if ("children" in node) {
        nodeInfo.children = node.children.map((child) => ({
          id: child.id,
          name: child.name,
          type: child.type,
        }));
      }
    
      // Add text-specific properties
      if (node.type === "TEXT") {
        nodeInfo.characters = node.characters;
        nodeInfo.fontSize = node.fontSize;
        nodeInfo.fontName = node.fontName;
      }
    
      return nodeInfo;
    }
  • Dispatch handler in handleCommand function that validates nodeId parameter and calls the getNodeInfo implementation for the "get_node_info" command.
    case "get_node_info":
      if (!params || !params.nodeId) {
        throw new Error("Missing nodeId parameter");
      }
      return await getNodeInfo(params.nodeId);
  • MCP tool registration for 'get_node_info' including description, input schema (nodeId: z.string()), and handler that proxies the command to the Figma plugin via sendCommandToFigma.
    server.tool(
      "get_node_info",
      "Get detailed information about a specific node in Figma",
      {
        nodeId: z.string().describe("The ID of the node to get information about")
      },
      async ({ nodeId }) => {
        try {
          const result = await sendCommandToFigma('get_node_info', { nodeId });
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(result, null, 2)
              }
            ]
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error getting node info: ${error instanceof Error ? error.message : String(error)}`
              }
            ]
          };
        }
      }
    );
  • Zod schema definition for the get_node_info tool input: requires nodeId as string.
    nodeId: z.string().describe("The ID of the node to get information about")
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden for behavioral disclosure. While 'Get detailed information' implies a read-only operation, it doesn't specify what 'detailed information' includes, whether there are rate limits, authentication requirements, or error conditions for invalid node IDs. For a tool with zero annotation coverage, this leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that immediately communicates the core purpose without unnecessary words. It's appropriately sized for a simple lookup tool and front-loads the essential information. Every word earns its place in this concise formulation.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete for proper tool understanding. While concise, it doesn't explain what 'detailed information' includes, how results are structured, or any behavioral constraints. For a tool in a complex Figma environment with many sibling alternatives, more context about scope and output would be valuable.

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?

The description adds no parameter information beyond what's already in the schema, which has 100% coverage for the single 'nodeId' parameter. The schema clearly describes it as 'The ID of the node to get information about.' With high schema coverage, the baseline score of 3 is appropriate since the description doesn't need to compensate but also adds no extra semantic context.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get detailed information') and resource ('about a specific node in Figma'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'get_nodes_info' (plural) or 'get_document_info', which could cause confusion about when to use this singular node info tool versus those alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'get_nodes_info' (plural nodes), 'get_document_info' (broader scope), and 'get_selection' (selected nodes), there's no indication whether this tool is for single nodes only, requires specific node types, or has different performance characteristics. The agent must infer usage from the name alone.

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

Install Server

Other Tools

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/yhc984/cursor-talk-to-figma-mcp-main'

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