Skip to main content
Glama
arinspunk

Claude Talk to Figma MCP

by arinspunk

get_node_info

Retrieve detailed information about a specific Figma design node, including its properties and child elements. Specify a node ID and optional depth to control how many levels of nested children return full details.

Instructions

Get detailed information about a specific node in Figma

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodeIdYesThe ID of the node to get information about
depthNoHow many child levels to include in full detail. Deeper levels return only id/name/type stubs.

Implementation Reference

  • The handler function for the 'get_node_info' tool. Registers the tool on the MCP server, accepts nodeId (string) and optional depth (number) parameters, calls sendCommandToFigma with the command, filters the result via filterFigmaNode, and returns JSON-stringified node info.
    // Node Info Tool
    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"),
        depth: z.number().int().min(0).optional().describe("How many child levels to include in full detail. Deeper levels return only id/name/type stubs."),
      },
      async ({ nodeId, depth }) => {
        try {
          const result = await sendCommandToFigma("get_node_info", { nodeId });
          const filtered = filterFigmaNode(result, depth ?? 1);
          const coordinateNote = filtered.absoluteBoundingBox && filtered.localPosition
            ? "absoluteBoundingBox contains global coordinates (relative to canvas). localPosition contains local coordinates (relative to parent, use these for move_node)."
            : undefined;
    
          const payload = coordinateNote ? { ...filtered, _note: coordinateNote } : filtered;
    
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(payload)
              }
            ]
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error getting node info: ${error instanceof Error ? error.message : String(error)}`,
              },
            ],
          };
        }
      }
    );
  • The FigmaCommand type definition that includes 'get_node_info' as a valid command string for type-safe commands to Figma.
    export type FigmaCommand =
      | "get_document_info"
      | "get_selection"
      | "get_node_info"
      | "create_rectangle"
      | "create_frame"
      | "create_text"
      | "create_ellipse"
      | "create_polygon"
      | "create_star"
      | "create_vector"
      | "create_line"
      | "set_fill_color"
      | "set_stroke_color"
      | "move_node"
      | "resize_node"
      | "delete_node"
      | "get_styles"
      | "get_local_components"
      | "get_team_components"
      | "create_component_instance"
      | "export_node_as_image"
      | "join"
      | "ping"
      | "set_corner_radius"
      | "clone_node"
      | "set_text_content"
      | "scan_text_nodes"
      | "set_multiple_text_contents"
      | "set_auto_layout"
      | "set_font_name"
      | "set_font_size"
      | "set_font_weight"
      | "set_letter_spacing"
      | "set_line_height"
      | "set_paragraph_spacing"
      | "set_text_case"
      | "set_text_decoration"
      | "get_styled_text_segments"
      | "load_font_async"
      | "get_remote_components"
      | "set_effects"
      | "set_effect_style_id"
      | "set_text_style_id"
      | "group_nodes"
      | "ungroup_nodes"
      | "flatten_node"
      | "insert_child"
      | "create_component_from_node"
      | "create_component_set"
      | "set_instance_variant"
      | "create_page"
      | "delete_page"
      | "rename_page"
      | "get_pages"
      | "set_current_page"
      | "rename_node"
      | "set_selection_colors"
      | "set_image_fill"
      | "get_image_from_node"
      | "replace_image_fill"
      // | "get_image_bytes" // COMMENTED OUT: Issues pending investigation
      | "apply_image_transform"
      | "set_image_filters"
      | "rotate_node"
      | "set_node_properties"
      | "reorder_node"
      | "duplicate_page"
      | "convert_to_frame"
      | "set_gradient"
      | "boolean_operation"
      | "set_svg"
      | "get_svg"
      | "set_image"
      | "set_grid"
      | "get_grid"
      | "set_guide"
      | "get_guide"
      | "set_annotation"
      | "get_annotation"
      | "get_variables"
      | "set_variable"
      | "apply_variable_to_node"
      | "switch_variable_mode"
      | "get_figjam_elements"
      | "create_sticky"
      | "set_sticky_text"
      | "create_shape_with_text"
      | "create_connector"
      | "create_section";
  • The registration entry point: registerTools() calls registerDocumentTools(server) which registers all document tools including get_node_info.
    export function registerTools(server: McpServer): void {
      // Register all tool categories
      registerDocumentTools(server);
  • The filterFigmaNode helper function used by the handler to recursively filter/reduce the Figma node response, converting colors to hex and limiting child depth based on the maxDepth parameter.
    export function filterFigmaNode(node: any, maxDepth: number = Infinity, currentDepth: number = 0) {
      // Skip VECTOR type nodes
      if (node.type === "VECTOR") {
        return null;
      }
    
      const filtered: any = {
        id: node.id,
        name: node.name,
        type: node.type,
      };
    
      if (node.fills && node.fills.length > 0) {
        filtered.fills = node.fills.map((fill: any) => {
          const processedFill = { ...fill };
    
          // Remove boundVariables and imageRef
          delete processedFill.boundVariables;
          delete processedFill.imageRef;
    
          // Process gradientStops if present
          if (processedFill.gradientStops) {
            processedFill.gradientStops = processedFill.gradientStops.map((stop: any) => {
              const processedStop = { ...stop };
              // Convert color to hex if present
              if (processedStop.color) {
                processedStop.color = rgbaToHex(processedStop.color);
              }
              // Remove boundVariables
              delete processedStop.boundVariables;
              return processedStop;
            });
          }
    
          // Convert solid fill colors to hex
          if (processedFill.color) {
            processedFill.color = rgbaToHex(processedFill.color);
          }
    
          return processedFill;
        });
      }
    
      if (node.strokes && node.strokes.length > 0) {
        filtered.strokes = node.strokes.map((stroke: any) => {
          const processedStroke = { ...stroke };
          // Remove boundVariables
          delete processedStroke.boundVariables;
          // Convert color to hex if present
          if (processedStroke.color) {
            processedStroke.color = rgbaToHex(processedStroke.color);
          }
          return processedStroke;
        });
      }
    
      if (node.cornerRadius !== undefined) {
        filtered.cornerRadius = node.cornerRadius;
      }
    
      if (node.absoluteBoundingBox) {
        filtered.absoluteBoundingBox = node.absoluteBoundingBox;
      }
    
      if (node.localPosition) {
        filtered.localPosition = node.localPosition;
      }
    
      if (node.characters) {
        filtered.characters = node.characters;
      }
    
      if (node.style) {
        filtered.style = {
          fontFamily: node.style.fontFamily,
          fontStyle: node.style.fontStyle,
          fontWeight: node.style.fontWeight,
          fontSize: node.style.fontSize,
          textAlignHorizontal: node.style.textAlignHorizontal,
          letterSpacing: node.style.letterSpacing,
          lineHeightPx: node.style.lineHeightPx
        };
      }
    
      if (node.children) {
        if (currentDepth >= maxDepth) {
          // Beyond depth: return only minimal child stubs so the model can request deeper info on demand
          filtered.children = node.children
            .filter((child: any) => child.type !== "VECTOR")
            .map((child: any) => ({ id: child.id, name: child.name, type: child.type }));
          if (filtered.children.length > 0) {
            filtered._childrenTruncated = true;
          }
        } else {
          filtered.children = node.children
            .map((child: any) => filterFigmaNode(child, maxDepth, currentDepth + 1))
            .filter((child: any) => child !== null); // Remove null children (VECTOR nodes)
        }
      }
    
      return filtered;
    }
  • The registerDocumentTools function that registers all document-related tools including get_node_info on the MCP server.
    export function registerDocumentTools(server: McpServer): void {
Behavior2/5

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

No annotations are provided, but the description does not disclose what 'detailed information' includes, such as properties or children. The depth parameter hints at nested detail, but overall behavioral traits are vague.

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

Conciseness4/5

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

The description is a single, front-loaded sentence with no waste. It could be slightly more informative without losing conciseness.

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?

Without an output schema, the description should explain what data the tool returns. It does not, leaving the agent uncertain about the response structure. Incomplete for a retrieval tool.

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?

Schema description coverage is 100%, so the schema already documents both parameters well. The description does not add significant meaning beyond 'specific node', earning a baseline score of 3.

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

Purpose5/5

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

The description clearly states 'Get detailed information about a specific node in Figma', using a specific verb and resource. It distinguishes from siblings like get_document_info and get_nodes_info.

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?

No guidance on when to use this tool versus alternatives (e.g., get_nodes_info for multiple nodes). The description offers no when-to-use or when-not-to-use context.

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/arinspunk/claude-talk-to-figma-mcp'

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