Skip to main content
Glama

get_file

Retrieve Figma files by key to access design data, including specific versions, node depth, and branch information for integration and analysis.

Instructions

Get a Figma file by key

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileKeyYesThe key of the file to get
versionNoOptional. A specific version ID to get
depthNoOptional. Depth of nodes to return (1-4)
branch_dataNoOptional. Include branch data if true

Implementation Reference

  • The handler function that implements the core logic of the 'get_file' tool by making an API request to Figma's /files/{fileKey} endpoint with optional parameters.
    async getFile(args) {
        const { fileKey, branch_data, ids, version, depth } = args;
        const params = {
            branch_data,
            version,
            depth
        };
        return this.api.makeRequest(`/files/${fileKey}${this.api.buildQueryString(params)}`);
    }
  • src/index.ts:490-496 (registration)
    The switch case in the CallToolRequest handler that routes 'get_file' calls to the FilesHandler.getFile method.
    case 'get_file': {
      const args = this.validateArgs<GetFileArgs>(request.params.arguments, ['fileKey']);
      const result = await this.filesHandler.getFile(args);
      return {
        content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
      };
    }
  • src/index.ts:114-139 (registration)
    The tool registration in the ListTools response, defining name, description, and inputSchema for 'get_file'.
    {
      name: 'get_file',
      description: 'Get a Figma file by key',
      inputSchema: {
        type: 'object',
        properties: {
          fileKey: {
            type: 'string',
            description: 'The key of the file to get'
          },
          version: {
            type: 'string',
            description: 'Optional. A specific version ID to get'
          },
          depth: {
            type: 'number',
            description: 'Optional. Depth of nodes to return (1-4)'
          },
          branch_data: {
            type: 'boolean',
            description: 'Optional. Include branch data if true'
          }
        },
        required: ['fileKey']
      },
    },
  • TypeScript interface defining the input arguments for the getFile handler, used for validation.
    export interface GetFileArgs extends BaseParams {
      fileKey: string;
      branch_data?: boolean;
    }
  • The JSON schema for the 'get_file' tool input, defining properties and requirements for MCP protocol.
    inputSchema: {
      type: 'object',
      properties: {
        fileKey: {
          type: 'string',
          description: 'The key of the file to get'
        },
        version: {
          type: 'string',
          description: 'Optional. A specific version ID to get'
        },
        depth: {
          type: 'number',
          description: 'Optional. Depth of nodes to return (1-4)'
        },
        branch_data: {
          type: 'boolean',
          description: 'Optional. Include branch data if true'
        }
      },
      required: ['fileKey']
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure but only states the basic action without details on permissions, rate limits, error handling, or response format. It doesn't mention if this is a read-only operation or what happens with invalid keys, which is insufficient 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 wasted words, front-loading the core purpose. It's appropriately sized for a simple retrieval tool, 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 no annotations and no output schema, the description is incomplete for a tool with four parameters and potential complexity (e.g., versioning, depth limits). It doesn't explain return values, error cases, or behavioral constraints, leaving significant gaps in understanding how to use it effectively.

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%, so the schema already documents all four parameters thoroughly. The description adds no additional meaning beyond implying 'fileKey' is required, which is already clear from the schema. This meets the baseline for high schema coverage.

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 ('a Figma file by key'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'get_file_nodes' or 'get_file_components' that also retrieve file-related data, which prevents a perfect 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 such as 'get_file_nodes' for node-level data or 'get_project_files' for listing files. It lacks explicit when/when-not instructions or prerequisite context, leaving usage unclear relative to siblings.

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