Skip to main content
Glama
ArchimedesCrypto

Figma MCP Server with Chunking

get_file_versions

Retrieve version history of a Figma file using the Figma MCP Server, which efficiently manages large files with chunking and pagination capabilities.

Instructions

Get version history of a Figma file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_keyYesFigma file key

Implementation Reference

  • MCP tool handler for 'get_file_versions' that validates the file_key argument, calls the figmaClient.getFileVersions method, and returns the result as a JSON-formatted text content block.
    case 'get_file_versions': {
      const args = request.params.arguments as unknown as FileKeyArgs;
      if (!args.file_key) {
        throw new McpError(ErrorCode.InvalidParams, 'file_key is required');
      }
      console.debug('[MCP Debug] Fetching file versions', {
        fileKey: args.file_key,
      });
      const data = await this.figmaClient.getFileVersions(args.file_key);
      return {
        content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
      };
    }
  • src/index.ts:164-177 (registration)
    Registration of the 'get_file_versions' tool in the ListTools response, including name, description, and input schema.
    {
      name: 'get_file_versions',
      description: 'Get version history of a Figma file',
      inputSchema: {
        type: 'object',
        properties: {
          file_key: {
            type: 'string',
            description: 'Figma file key'
          }
        },
        required: ['file_key']
      }
    },
  • Implementation of getFileVersions in ChunkedFigmaClient that makes the Figma API request to retrieve file version history and returns the response data, with memory limit check.
    async getFileVersions(fileKey: string) {
      try {
        console.debug('[MCP Debug] Getting versions for file:', fileKey);
        const response = await this.client.get(`/files/${fileKey}/versions`);
        
        if (this.nodeProcessor.hasReachedLimit()) {
          console.debug('[MCP Debug] Memory limit reached while processing versions');
          throw new Error('Memory limit exceeded while processing versions');
        }
    
        return response.data;
      } catch (error) {
        console.error('[MCP Error] Failed to get file versions:', error);
        throw error;
      }
    }

Tool Definition Quality

Score is being calculated. Check back soon.

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/ArchimedesCrypto/figma-mcp-chunked'

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