penpot_tree_schema
Extract the Penpot object tree schema in JSON format to enable AI-driven analysis, search, and automated workflows within the Penpot MCP Server.
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 that implements the core logic of the 'penpot_tree_schema' tool by loading and returning the Penpot tree schema JSON file.@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:146-154 (registration)Registration of the 'penpot_tree_schema' as an MCP resource (penpot://tree-schema), which shares the same implementation as the tool version.@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)}"}
- penpot_mcp/server/mcp_server.py:88-93 (registration)Conditional logic in server initialization that controls whether resources like penpot_tree_schema are registered as tools.if config.RESOURCES_AS_TOOLS: self._register_resources(resources_only=True) self._register_tools(include_resource_tools=True) else: self._register_resources(resources_only=False) self._register_tools(include_resource_tools=False)