Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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)}"}
  • Conditional registration of resource tools including 'penpot_tree_schema' when config.RESOURCES_AS_TOOLS is True.
    self._register_tools(include_resource_tools=True)
  • 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)}"}

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/montevive/penpot-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server