penpot_tree_schema
Retrieve the JSON schema for Penpot design object trees to enable AI analysis and interaction with design files programmatically.
Instructions
Provide the Penpot object tree schema as JSON.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- penpot_mcp/server/mcp_server.py:380-388 (handler)The handler function for the 'penpot_tree_schema' tool. It loads the Penpot tree schema from the resources directory and returns it as a JSON dictionary. This is the core implementation executing the tool logic.@self.mcp.tool() def penpot_tree_schema() -> dict: """Provide the Penpot object tree schema as JSON.""" schema_path = os.path.join(config.RESOURCES_PATH, 'penpot-tree-schema.json') try: with open(schema_path, 'r') as f: return json.load(f) except Exception as e: return {"error": f"Failed to load tree schema: {str(e)}"}
- penpot_mcp/server/mcp_server.py:90-90 (registration)Conditional registration of resource tools including 'penpot_tree_schema' when config.RESOURCES_AS_TOOLS is True.self._register_tools(include_resource_tools=True)
- penpot_mcp/server/mcp_server.py:146-154 (handler)Similar handler registered as an MCP resource at 'penpot://tree-schema', providing the same schema loading logic.@self.mcp.resource("penpot://tree-schema", mime_type="application/schema+json") def penpot_tree_schema() -> dict: """Provide the Penpot object tree schema as JSON.""" schema_path = os.path.join(config.RESOURCES_PATH, 'penpot-tree-schema.json') try: with open(schema_path, 'r') as f: return json.load(f) except Exception as e: return {"error": f"Failed to load tree schema: {str(e)}"}