penpot_schema
Generate Penpot API schema in JSON format for integrating AI assistants with the Penpot design platform, enabling automated design workflows and file interactions.
Instructions
Provide the Penpot API schema as JSON.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- penpot_mcp/server/mcp_server.py:372-379 (handler)The handler function implementing the 'penpot_schema' tool logic. This tool loads and returns the Penpot API JSON schema from the resources directory.def penpot_schema() -> dict: """Provide the Penpot API schema as JSON.""" schema_path = os.path.join(config.RESOURCES_PATH, 'penpot-schema.json') try: with open(schema_path, 'r') as f: return json.load(f) except Exception as e: return {"error": f"Failed to load schema: {str(e)}"}
- penpot_mcp/server/mcp_server.py:88-93 (registration)Registration logic in the server __init__ method that conditionally registers the resource tools including 'penpot_schema' when config.RESOURCES_AS_TOOLS is True.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)
- The same handler function registered as an MCP resource at 'penpot://schema', providing the Penpot schema for reference.@self.mcp.resource("penpot://schema", mime_type="application/schema+json") def penpot_schema() -> dict: """Provide the Penpot API schema as JSON.""" schema_path = os.path.join(config.RESOURCES_PATH, 'penpot-schema.json') try: with open(schema_path, 'r') as f: return json.load(f) except Exception as e: return {"error": f"Failed to load schema: {str(e)}"}