get_project_files
Retrieve all files within a specified Penpot project by providing the project ID, enabling programmatic access to design assets for automation and analysis.
Instructions
Get all files contained within a specific Penpot project.
Args:
project_id: The ID of the Penpot project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes |
Implementation Reference
- penpot_mcp/server/mcp_server.py:176-187 (handler)The MCP tool handler for 'get_project_files'. Registers the tool and implements the logic by calling PenpotAPI.get_project_files(project_id), wrapping results and errors.@self.mcp.tool() def get_project_files(project_id: str) -> dict: """Get all files contained within a specific Penpot project. Args: project_id: The ID of the Penpot project """ try: files = self.api.get_project_files(project_id) return {"files": files} except Exception as e: return self._handle_api_error(e)
- penpot_mcp/api/penpot_api.py:518-539 (helper)PenpotAPI helper method that makes the authenticated HTTP POST request to Penpot's get-project-files RPC endpoint to retrieve the list of files in a project.def get_project_files(self, project_id: str) -> List[Dict[str, Any]]: """ Get all files for a specific project. Args: project_id: The ID of the project Returns: List of file information dictionaries """ url = f"{self.base_url}/rpc/command/get-project-files" payload = { "project-id": project_id } response = self._make_authenticated_request('post', url, json=payload, use_transit=False) # Parse JSON files = response.json() return files