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']

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