Skip to main content
Glama
ArchimedesCrypto

Figma MCP Server with Chunking

get_components

Extract components from a Figma file using an API tool designed for handling large files efficiently with memory-aware chunking and pagination.

Instructions

Get components from a Figma file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_keyYesFigma file key

Implementation Reference

  • The core handler function in ChunkedFigmaClient class that executes the tool logic: fetches components from Figma API `/files/${fileKey}/components`, checks memory limit via nodeProcessor, returns the response data.
    async getComponents(fileKey: string) {
      try {
        console.debug('[MCP Debug] Getting components for file:', fileKey);
        const response = await this.client.get(`/files/${fileKey}/components`);
        
        if (this.nodeProcessor.hasReachedLimit()) {
          console.debug('[MCP Debug] Memory limit reached while processing components');
          throw new Error('Memory limit exceeded while processing components');
        }
    
        return response.data;
      } catch (error) {
        console.error('[MCP Error] Failed to get components:', error);
        throw error;
      }
    }
  • src/index.ts:192-205 (registration)
    Registers the 'get_components' tool in the MCP server's ListTools response, including name, description, and input schema requiring 'file_key'.
    {
      name: 'get_components',
      description: 'Get components from a Figma file',
      inputSchema: {
        type: 'object',
        properties: {
          file_key: {
            type: 'string',
            description: 'Figma file key'
          }
        },
        required: ['file_key']
      }
    },
  • The MCP server request handler for CallToolRequestSchema that dispatches 'get_components': validates input, calls figmaClient.getComponents, formats response as JSON text content.
    case 'get_components': {
      const args = request.params.arguments as unknown as FileKeyArgs;
      if (!args.file_key) {
        throw new McpError(ErrorCode.InvalidParams, 'file_key is required');
      }
      console.debug('[MCP Debug] Fetching components', {
        fileKey: args.file_key,
      });
      const data = await this.figmaClient.getComponents(args.file_key);
      return {
        content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
      };
    }
  • Input schema definition for the 'get_components' tool, specifying object with required 'file_key' string property.
    inputSchema: {
      type: 'object',
      properties: {
        file_key: {
          type: 'string',
          description: 'Figma file key'
        }
      },
      required: ['file_key']
    }
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' implies a read operation, it doesn't specify whether this requires authentication, has rate limits, returns paginated results, or what format/components are included. 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 with zero wasted words. It's appropriately sized for a simple retrieval tool and immediately communicates the core functionality without unnecessary elaboration.

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

Completeness3/5

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

For a simple single-parameter read tool, the description is minimally adequate but has clear gaps. With no annotations and no output schema, it doesn't explain what 'components' are, what format they're returned in, or any behavioral constraints. The description meets basic requirements but leaves important contextual questions unanswered.

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 fully documents the single 'file_key' parameter. The description doesn't add any parameter semantics beyond what's in the schema, such as explaining what a 'Figma file key' represents or providing examples. The baseline 3 is appropriate when 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 action ('Get') and target resource ('components from a Figma file'), making the tool's purpose immediately understandable. However, it doesn't differentiate this tool from its siblings like 'get_file_nodes' or 'get_file_data', which likely retrieve different types of file content.

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_file_nodes' and 'get_file_data' that might retrieve similar file content, there's no indication of what distinguishes 'components' from other file elements or when this specific retrieval is appropriate.

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

Related 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/ArchimedesCrypto/figma-mcp-chunked'

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