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) }],
      };
    }
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 offers minimal insight. It implies a read operation ('Get'), but does not specify if it's paginated (though parameters suggest it), what the output format is, or any constraints like rate limits or authentication needs. This leaves key behavioral traits undocumented.

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 extremely concise with a single sentence 'Get files for a project', which is front-loaded and wastes no words. It efficiently communicates the core purpose without unnecessary elaboration, making it easy to parse quickly.

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 a tool with 4 parameters, no annotations, and no output schema, the description is incomplete. It fails to explain what 'files' entail, how pagination works with 'page_size' and 'cursor', the effect of 'branch_data', or the return structure. This leaves significant gaps for an agent to understand and use the tool effectively.

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?

Schema description coverage is 100%, with all parameters well-documented in the schema (e.g., 'project_id' as required, 'page_size' for pagination). The description adds no additional meaning beyond the schema, such as explaining how 'branch_data' affects results or typical use cases for parameters. Baseline score of 3 is appropriate as the schema handles parameter documentation adequately.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get files for a project' clearly states the verb ('Get') and resource ('files for a project'), making the purpose understandable. However, it lacks specificity about what 'files' means in this context (e.g., metadata, content, types) and does not differentiate from siblings like 'get_file' or 'get_file_components', which could lead to confusion about scope.

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?

The description provides no guidance on when to use this tool versus alternatives. It does not mention prerequisites (e.g., needing a valid project_id), exclusions, or comparisons to siblings such as 'get_file' (for individual files) or 'get_file_components' (for components within files), leaving the agent to infer usage from context alone.

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

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