get_file
Retrieve a specific Penpot design file using its unique ID and cache it for programmatic access. Facilitates automated workflows by enabling AI models to interact with design files directly.
Instructions
Retrieve a Penpot file by its ID and cache it. Don't use this tool for code generation, use 'get_object_tree' instead.
Args:
file_id: The ID of the Penpot file
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_id | Yes |
Implementation Reference
- penpot_mcp/server/mcp_server.py:203-215 (handler)The main handler function for the 'get_file' MCP tool. It fetches the file data from the Penpot API using self.api.get_file and caches it in self.file_cache before returning the data.@self.mcp.tool() def get_file(file_id: str) -> dict: """Retrieve a Penpot file by its ID and cache it. Don't use this tool for code generation, use 'get_object_tree' instead. Args: file_id: The ID of the Penpot file """ try: file_data = self.api.get_file(file_id=file_id) self.file_cache.set(file_id, file_data) return file_data except Exception as e: return self._handle_api_error(e)