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 }

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