Skip to main content
Glama
paragdesai1

Cursor Talk to Figma MCP

by paragdesai1

get_nodes_info

Retrieve detailed information about multiple Figma design nodes by providing their IDs, enabling analysis of design elements within the Cursor AI environment.

Instructions

Get detailed information about multiple nodes in Figma

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodeIdsYesArray of node IDs to get information about

Implementation Reference

  • Registration of the MCP tool 'get_nodes_info' with input schema (nodeIds: array of strings) and handler that fetches info for each node using underlying 'get_node_info' command and applies filtering.
    server.tool(
      "get_nodes_info",
      "Get detailed information about multiple nodes in Figma",
      {
        nodeIds: z.array(z.string()).describe("Array of node IDs to get information about")
      },
      async ({ nodeIds }) => {
        try {
          const results = await Promise.all(
            nodeIds.map(async (nodeId) => {
              const result = await sendCommandToFigma('get_node_info', { nodeId });
              return { nodeId, info: result };
            })
          );
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(results.map((result) => filterFigmaNode(result.info)))
              }
            ]
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error getting nodes info: ${error instanceof Error ? error.message : String(error)}`
              }
            ]
          };
        }
      }
    );
  • Handler function for get_nodes_info: iterates over nodeIds, calls sendCommandToFigma('get_node_info') for each, collects results, filters with filterFigmaNode, and returns as JSON text content.
    async ({ nodeIds }) => {
      try {
        const results = await Promise.all(
          nodeIds.map(async (nodeId) => {
            const result = await sendCommandToFigma('get_node_info', { nodeId });
            return { nodeId, info: result };
          })
        );
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(results.map((result) => filterFigmaNode(result.info)))
            }
          ]
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Error getting nodes info: ${error instanceof Error ? error.message : String(error)}`
            }
          ]
        };
      }
    }
  • Input schema for get_nodes_info tool: requires nodeIds as array of strings.
    {
      nodeIds: z.array(z.string()).describe("Array of node IDs to get information about")
    },
  • Helper function filterFigmaNode used by the handler to process and clean Figma node data: skips VECTOR nodes, converts RGBA colors to hex, removes boundVariables and imageRef, recursively processes children.
    function filterFigmaNode(node: any) {
      // 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.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) {
        filtered.children = node.children
          .map((child: any) => filterFigmaNode(child))
          .filter((child: any) => child !== null); // Remove null children (VECTOR nodes)
      }
    
      return filtered;
    }
  • Helper function rgbaToHex to convert RGBA color objects to hex strings, used within filterFigmaNode.
    function rgbaToHex(color: any): string {
      // skip if color is already hex
      if (color.startsWith('#')) {
        return color;
      }
    
      const r = Math.round(color.r * 255);
      const g = Math.round(color.g * 255);
      const b = Math.round(color.b * 255);
      const a = Math.round(color.a * 255);
    
      return `#${r.toString(16).padStart(2, '0')}${g.toString(16).padStart(2, '0')}${b.toString(16).padStart(2, '0')}${a === 255 ? '' : a.toString(16).padStart(2, '0')}`;
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states it 'gets' information, implying a read-only operation, but doesn't disclose behavioral traits like rate limits, authentication needs, error handling (e.g., invalid node IDs), or what 'detailed information' includes (e.g., node properties, metadata). This leaves significant gaps for an AI agent.

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 directly states the tool's purpose without any fluff or redundancy. It is front-loaded with the core action and resource, making it easy to parse quickly.

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 complexity of a Figma API tool with no annotations and no output schema, the description is incomplete. It doesn't explain what 'detailed information' entails (e.g., JSON structure, fields like name, type, bounds), potential limitations, or how results are returned. This leaves the AI agent with insufficient context for effective use.

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%, with the parameter 'nodeIds' fully documented in the schema as 'Array of node IDs to get information about'. The description adds no additional meaning beyond this, such as format examples, constraints (e.g., maximum array size), or where to obtain node IDs. Baseline 3 is appropriate since the schema does the heavy lifting.

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 verb 'Get' and resource 'detailed information about multiple nodes in Figma', which is specific and unambiguous. It distinguishes from sibling 'get_node_info' by specifying 'multiple nodes' versus presumably a single node, though it doesn't explicitly mention this distinction in the description itself.

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 like 'get_node_info' (for single nodes) or 'get_document_info' (for broader document data). It lacks any context about prerequisites, such as needing valid node IDs or being in a specific Figma document state.

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/paragdesai1/parag-Figma-MCP'

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