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
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | The project ID | |
| page_size | No | Optional. Number of items per page | |
| cursor | No | Optional. Cursor for pagination | |
| branch_data | No | Optional. Include branch data if true |
Implementation Reference
- src/handlers/projects.ts:24-29 (handler)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)}`); }
- src/types/projects.ts:7-10 (schema)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) }], }; }