Skip to main content
Glama
andreycretsu

Cursor Talk to Figma MCP

by andreycretsu

scan_text_nodes

Extract text content from Figma design elements to analyze or process text within selected nodes programmatically.

Instructions

Scan all text nodes in the selected Figma node

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodeIdYesID of the node to scan

Implementation Reference

  • MCP tool handler implementation for 'scan_text_nodes'. This function proxies the request to the Figma plugin via sendCommandToFigma, handles progress reporting, formats the response with summary and text nodes list, and includes schema validation for nodeId input.
    server.tool(
      "scan_text_nodes",
      "Scan all text nodes in the selected Figma node",
      {
        nodeId: z.string().describe("ID of the node to scan"),
      },
      async ({ nodeId }) => {
        try {
          // Initial response to indicate we're starting the process
          const initialStatus = {
            type: "text" as const,
            text: "Starting text node scanning. This may take a moment for large designs...",
          };
    
          // Use the plugin's scan_text_nodes function with chunking flag
          const result = await sendCommandToFigma("scan_text_nodes", {
            nodeId,
            useChunking: true,  // Enable chunking on the plugin side
            chunkSize: 10       // Process 10 nodes at a time
          });
    
          // If the result indicates chunking was used, format the response accordingly
          if (result && typeof result === 'object' && 'chunks' in result) {
            const typedResult = result as {
              success: boolean,
              totalNodes: number,
              processedNodes: number,
              chunks: number,
              textNodes: Array<any>
            };
    
            const summaryText = `
            Scan completed:
            - Found ${typedResult.totalNodes} text nodes
            - Processed in ${typedResult.chunks} chunks
            `;
    
            return {
              content: [
                initialStatus,
                {
                  type: "text" as const,
                  text: summaryText
                },
                {
                  type: "text" as const,
                  text: JSON.stringify(typedResult.textNodes, null, 2)
                }
              ],
            };
          }
    
          // If chunking wasn't used or wasn't reported in the result format, return the result as is
          return {
            content: [
              initialStatus,
              {
                type: "text",
                text: JSON.stringify(result, null, 2),
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error scanning text nodes: ${error instanceof Error ? error.message : String(error)
                  }`,
              },
            ],
          };
        }
      }
    );
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the action without disclosing behavioral traits such as what 'scan' entails (e.g., returns text content, counts nodes, error handling), permissions needed, or rate limits. This leaves significant gaps for a tool that likely reads data.

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 function without unnecessary words. It is front-loaded and appropriately sized for its purpose, earning full marks for 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?

Given no annotations, no output schema, and a single parameter with full schema coverage, the description is incomplete. It lacks details on what the scan returns (e.g., list of text nodes, content), error cases, or behavioral context, making it inadequate for effective tool 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?

The input schema has 100% description coverage, with 'nodeId' clearly documented. The description adds no additional meaning beyond the schema, such as format examples or constraints, so it meets the baseline for high schema coverage without compensating value.

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 ('scan') and target ('all text nodes in the selected Figma node'), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'scan_nodes_by_types' or 'get_node_info', which could provide similar functionality, so it doesn't reach the highest score.

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 'scan_nodes_by_types' or 'get_node_info', nor does it mention prerequisites or exclusions. It merely states what the tool does without context for selection.

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

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