Skip to main content
Glama
ArchimedesCrypto

Figma MCP Server with Chunking

get_styles

Extract styles from a Figma file using a memory-efficient MCP server, enabling handling of large files with chunking and pagination for optimized performance.

Instructions

Get styles from a Figma file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_keyYesFigma file key

Implementation Reference

  • src/index.ts:206-219 (registration)
    Registration of the 'get_styles' tool in the ListTools handler, including name, description, and input schema definition.
    {
      name: 'get_styles',
      description: 'Get styles from a Figma file',
      inputSchema: {
        type: 'object',
        properties: {
          file_key: {
            type: 'string',
            description: 'Figma file key'
          }
        },
        required: ['file_key']
      }
    },
  • MCP tool handler for 'get_styles': validates file_key argument, calls figmaClient.getStyles(), and returns JSON response.
    case 'get_styles': {
      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 styles', {
        fileKey: args.file_key,
      });
      const data = await this.figmaClient.getStyles(args.file_key);
      return {
        content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
      };
    }
  • Core implementation of getStyles in ChunkedFigmaClient: makes API call to Figma /files/{fileKey}/styles endpoint and returns the data.
    async getStyles(fileKey: string) {
      try {
        console.debug('[MCP Debug] Getting styles for file:', fileKey);
        const response = await this.client.get(`/files/${fileKey}/styles`);
        
        if (this.nodeProcessor.hasReachedLimit()) {
          console.debug('[MCP Debug] Memory limit reached while processing styles');
          throw new Error('Memory limit exceeded while processing styles');
        }
    
        return response.data;
      } catch (error) {
        console.error('[MCP Error] Failed to get styles:', error);
        throw error;
      }
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states a read operation ('Get'), implying it's likely safe, but doesn't mention permissions, rate limits, pagination, or what 'styles' encompasses (e.g., text styles, color styles). This leaves significant gaps for a tool with no annotation coverage.

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 waste. It's front-loaded with the core action and resource, making it easy to parse quickly without unnecessary elaboration.

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. It doesn't explain what 'styles' includes, the return format, or any behavioral traits like error handling. For a tool with no structured support, more context is needed to be fully helpful.

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 schema description coverage is 100%, with the single parameter 'file_key' documented as 'Figma file key'. The description adds no additional meaning beyond this, such as format examples or where to find the key. Since the schema does the heavy lifting, the baseline score of 3 is appropriate.

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 ('styles from a Figma file'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'get_components' or 'get_file_nodes', which also retrieve specific elements from Figma files, so it lacks sibling distinction.

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_components' or 'get_file_data'. It doesn't specify context, prerequisites, or exclusions, leaving the agent to infer usage based on tool names 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

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