Skip to main content
Glama

get_file_styles

Retrieve style definitions from Figma files to access color palettes, typography settings, and design tokens for consistent implementation.

Instructions

Get styles from a file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileKeyYesThe key of the file to get styles from

Implementation Reference

  • The core handler function implementing the get_file_styles tool. It extracts the fileKey from args and makes an API request to Figma's /files/{fileKey}/styles endpoint.
    async getFileStyles(args: GetFileStylesArgs) {
      const { fileKey } = args;
      
      return this.api.makeRequest(`/files/${fileKey}/styles`);
    }
  • TypeScript interface defining the input arguments for the get_file_styles tool: requires a fileKey string.
    export interface GetFileStylesArgs {
      fileKey: string;
    }
  • src/index.ts:433-446 (registration)
    MCP tool registration including name, description, and input schema matching GetFileStylesArgs.
    {
      name: 'get_file_styles',
      description: 'Get styles from a file',
      inputSchema: {
        type: 'object',
        properties: {
          fileKey: {
            type: 'string',
            description: 'The key of the file to get styles from'
          }
        },
        required: ['fileKey']
      },
    },
  • Dispatch handler in the main CallToolRequestHandler switch statement that validates args and delegates to projectsHandler.getFileStyles.
    case 'get_file_styles': {
      const args = this.validateArgs<GetFileStylesArgs>(request.params.arguments, ['fileKey']);
      const result = await this.projectsHandler.getFileStyles(args);
      return {
        content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
      };
    }
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 'Get styles' but doesn't disclose behavioral traits such as whether this is a read-only operation, what permissions are needed, if it returns a list or object, or any rate limits. 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.

Conciseness4/5

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

The description is a single, efficient sentence with no wasted words. It's front-loaded and to the point, though 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?

Given the complexity (a read operation with no annotations and no output schema), the description is incomplete. It doesn't explain what 'styles' are, the return format, or any error conditions. For a tool with no structured output, 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 input schema has 100% description coverage, with 'fileKey' clearly documented. The description doesn't add any meaning beyond the schema, such as explaining what a 'fileKey' is or providing examples. 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.

Purpose3/5

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

The description 'Get styles from a file' clearly states the action (get) and target (styles from a file), but it's vague about what 'styles' means in this context (e.g., design styles, formatting styles). It doesn't distinguish from siblings like 'get_style' (singular) or 'get_team_styles', leaving ambiguity in scope.

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 is provided on when to use this tool versus alternatives. For example, it doesn't clarify if this is for file-specific styles versus team-wide styles (like 'get_team_styles'), or when to use 'get_style' instead. The description lacks any context or exclusions.

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/smithery-ai/mcp-figma'

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