Skip to main content
Glama

figma_get_file_data

Retrieve detailed Figma file data including nodes, geometry paths, and plugin information using file keys and node IDs. Essential for developers and designers accessing specific file details.

Instructions

Get detailed information about a Figma file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
branch_dataNoSpecify whether to return branch data
depthNoSpecify the depth of nodes to return
fileKeyYesUnique identifier of the Figma file
geometryNoSpecify whether to include geometry path data
idsYesList of node IDs to retrieve, comma separated
personalTokenNoYour Figma personal access token
plugin_dataNoSpecify plugin data to return
versionNoSpecify the version to return

Implementation Reference

  • The handler function for the figma_get_file_data tool that invokes the api.files helper and formats the response as text or error message.
    async (o): Promise<CallToolResult> => {
      try {
        const data = await api.files(o)
        return {
          content: [{type: 'text', text: JSON.stringify(data)}],
        }
      } catch (error: any) {
        return {
          content: [{type: 'text', text: `Error: ${error.message}`}],
        }
      }
    },
  • Zod schema defining the input parameters for the figma_get_file_data tool.
    {
      fileKey: z.string().describe('Unique identifier of the Figma file'),
      ids: z.string().describe('List of node IDs to retrieve, comma separated'),
      personalToken: z
        .string()
        .optional()
        .describe('Your Figma personal access token, The parameters are not required when the tool is called.'),
      version: z.string().optional().describe('Specify the version to return'),
      depth: z.number().optional().describe('Specify the depth of nodes to return'),
      geometry: z.enum(['paths']).optional().describe('Specify whether to include geometry path data'),
      plugin_data: z.string().optional().describe('Specify plugin data to return'),
      branch_data: z.boolean().optional().describe('Specify whether to return branch data'),
    },
  • Registration of the figma_get_file_data tool on the MCP server using server.tool method.
    server.tool(
      'figma_get_file_data',
      'Get detailed information about a Figma file',
      {
        fileKey: z.string().describe('Unique identifier of the Figma file'),
        ids: z.string().describe('List of node IDs to retrieve, comma separated'),
        personalToken: z
          .string()
          .optional()
          .describe('Your Figma personal access token, The parameters are not required when the tool is called.'),
        version: z.string().optional().describe('Specify the version to return'),
        depth: z.number().optional().describe('Specify the depth of nodes to return'),
        geometry: z.enum(['paths']).optional().describe('Specify whether to include geometry path data'),
        plugin_data: z.string().optional().describe('Specify plugin data to return'),
        branch_data: z.boolean().optional().describe('Specify whether to return branch data'),
      },
      async (o): Promise<CallToolResult> => {
        try {
          const data = await api.files(o)
          return {
            content: [{type: 'text', text: JSON.stringify(data)}],
          }
        } catch (error: any) {
          return {
            content: [{type: 'text', text: `Error: ${error.message}`}],
          }
        }
      },
    )
  • Core helper method in FigmaRestApi that constructs the appropriate Figma API URL for file/nodes data and fetches it.
    async files(o: GetFileParams) {
      let url: string
      if (o.ids) {
        url = this.opToUrl(`${this.figmaHost}/files/${o.fileKey}/nodes`, o)
      } else {
        url = this.opToUrl(`${this.figmaHost}/files/${o.fileKey}`, o)
      }
    
      return this.fetch(url)
    }
  • TypeScript interface defining the input parameters (GetFileParams) used by the api.files helper.
    export interface GetFileParams {
      fileKey: string
      ids?: string
      version?: string
      depth?: number
      geometry?: 'paths'
      plugin_data?: string
      branch_data?: boolean
      personalToken?: string
    }
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 but only states what the tool does without mentioning permissions, rate limits, or output format. It lacks details on authentication needs (implied by 'personalToken' parameter but not explained), potential data size, or error handling, making it insufficient for safe and effective use.

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, front-loaded sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized for a simple retrieval tool, making it efficient and easy to parse.

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 of 8 parameters, no annotations, and no output schema, the description is incomplete. It doesn't address how the tool behaves, what the output includes, or usage context, leaving significant gaps for an AI agent to understand and invoke the tool correctly in a real-world scenario.

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 parameters thoroughly. The description adds no additional meaning beyond implying 'detailed information' relates to the parameters, but it doesn't explain how parameters like 'depth' or 'geometry' affect the output, resulting in a baseline score with minimal added 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 ('Get') and resource ('detailed information about a Figma file'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'figma_get_file_meta' which might retrieve similar metadata, leaving some ambiguity about what distinguishes 'detailed information' from meta information.

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. The description doesn't mention sibling tools or contexts where this tool is preferred, such as for retrieving node-specific data versus file metadata, leaving the agent without usage direction.

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

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