Skip to main content
Glama

get_project_files

Retrieve Figma project files by ID, with options for pagination and branch data inclusion to manage design assets.

Instructions

Get files for a project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYesThe project ID
page_sizeNoOptional. Number of items per page
cursorNoOptional. Cursor for pagination
branch_dataNoOptional. Include branch data if true

Implementation Reference

  • The core handler function for the 'get_project_files' tool. It extracts parameters from args, builds query params, and calls the Figma API to fetch files for the specified project.
    async getProjectFiles(args: GetProjectFilesArgs) {
      const { project_id, branch_data, ...paginationParams } = args;
      
      const params = { ...paginationParams, branch_data };
      return this.api.makeRequest(`/projects/${project_id}/files${this.api.buildQueryString(params)}`);
    }
  • TypeScript interface defining the input schema for the get_project_files tool, including required project_id and optional pagination/branch_data.
    export interface GetProjectFilesArgs extends PaginationParams {
      project_id: string;
      branch_data?: boolean;
    }
  • src/index.ts:313-338 (registration)
    Tool registration in ListTools handler, defining name, description, and inputSchema matching GetProjectFilesArgs.
    {
      name: 'get_project_files',
      description: 'Get files for a project',
      inputSchema: {
        type: 'object',
        properties: {
          project_id: {
            type: 'string',
            description: 'The project ID'
          },
          page_size: {
            type: 'number',
            description: 'Optional. Number of items per page'
          },
          cursor: {
            type: 'string',
            description: 'Optional. Cursor for pagination'
          },
          branch_data: {
            type: 'boolean',
            description: 'Optional. Include branch data if true'
          }
        },
        required: ['project_id']
      },
    },
  • src/index.ts:554-560 (registration)
    Switch case in CallToolRequest handler that routes 'get_project_files' calls to the projectsHandler.getProjectFiles method after validation.
    case 'get_project_files': {
      const args = this.validateArgs<GetProjectFilesArgs>(request.params.arguments, ['project_id']);
      const result = await this.projectsHandler.getProjectFiles(args);
      return {
        content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
      };
    }

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