{"openapi":"3.1.0","info":{"title":"UML Diagram Generator","description":"API for generating UML and other diagrams; MCP at /mcp (Streamable HTTP — use an MCP client). [Swagger UI](/docs) · [ReDoc](/redoc) · [OpenAPI JSON](/openapi.json)","version":"1.4.0"},"paths":{"/":{"get":{"tags":["rest"],"summary":"Root","description":"Root: JSON by default; ``Accept: text/html`` or ``text/markdown`` for agents.","operationId":"root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health":{"get":{"tags":["rest"],"summary":"Health Check","description":"Health check endpoint","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/generate_diagram":{"post":{"tags":["rest"],"summary":"Generate Diagram Endpoint","description":"Generate a diagram from text","operationId":"generate_diagram_endpoint_generate_diagram_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiagramRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiagramResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/kroki_encode":{"post":{"tags":["rest"],"summary":"Kroki Encode Endpoint","description":"Return the Kroki-encoded URL for a diagram (no file write). Use when running on a read-only filesystem (e.g. serverless).","operationId":"kroki_encode_endpoint_kroki_encode_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KrokiEncodeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KrokiEncodeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/ag-ui":{"post":{"tags":["agui"],"summary":"Agui Protocol Run","description":"Run UML-MCP through the canonical AG-UI HTTP/SSE contract.\n\nThis endpoint accepts the standard camelCase RunAgentInput shape used by\n@ag-ui/client HttpAgent and emits canonical AG-UI events. Existing\n/ag-ui/generate and start/events routes remain available for backwards\ncompatibility with the earlier UML-MCP-specific request/event shape.","operationId":"agui_protocol_run_ag_ui_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AguiProtocolRunInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/ag-ui/start":{"post":{"tags":["agui"],"summary":"Agui Start","description":"Start an AG-UI diagram run and return the SSE events URL (start-then-subscribe).\n\nGeneration runs in the background; subscribe to ``GET /ag-ui/events/{run_id}`` to\nstream RUN_STARTED/TOOL_CALL_*/RUN_FINISHED events and render the diagram inline.","operationId":"agui_start_ag_ui_start_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AguiRunRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AguiRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/ag-ui/events/{run_id}":{"get":{"tags":["agui"],"summary":"Agui Events","description":"Stream the AG-UI events for a started run as Server-Sent Events.","operationId":"agui_events_ag_ui_events__run_id__get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/ag-ui/generate":{"post":{"tags":["agui"],"summary":"Agui Generate","description":"Render a diagram and stream the full AG-UI event sequence over SSE in one request.\n\nStateless (no run store) — the recommended path on serverless deployments such as\nVercel. The terminal CUSTOM event carries the generative-UI payload (base64 image,\nURL, editable source) so frontends render the diagram inline.","operationId":"agui_generate_ag_ui_generate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AguiRunRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/logo.png":{"get":{"tags":["well-known"],"summary":"Get Logo","description":"Return the logo for the plugin (used by AI plugin manifests).","operationId":"get_logo_logo_png_get","responses":{"200":{"description":"Plugin logo (ICO format, used by AI plugin manifests).","content":{"application/json":{"schema":{}},"image/x-icon":{"schema":{"type":"string","format":"binary"}}}}}}},"/.well-known/ai-plugin.json":{"get":{"tags":["well-known"],"summary":"Get Plugin Manifest","description":"Return the plugin manifest for OpenAI plugins  (base URL from request).","operationId":"get_plugin_manifest__well_known_ai_plugin_json_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/.well-known/mcp/server-card.json":{"get":{"tags":["well-known"],"summary":"Get Mcp Server Card","description":"MCP server metadata for other registries (SEP-1649 server card).","operationId":"get_mcp_server_card__well_known_mcp_server_card_json_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/.well-known/privacy.txt":{"get":{"tags":["well-known"],"summary":"Get Privacy Policy","description":"Return the privacy policy for the plugin","operationId":"get_privacy_policy__well_known_privacy_txt_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/supported_formats":{"get":{"tags":["rest"],"summary":"Get Supported Formats","description":"Return the supported diagram formats","operationId":"get_supported_formats_supported_formats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/openapi.yaml":{"get":{"tags":["openapi"],"summary":"Get Openapi Yaml","description":"Return the OpenAPI specification in YAML format (for AI tools and ReDoc).","operationId":"get_openapi_yaml_openapi_yaml_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"AguiProtocolRunInput":{"properties":{"threadId":{"type":"string","minLength":1,"title":"Threadid"},"runId":{"type":"string","minLength":1,"title":"Runid"},"parentRunId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parentrunid"},"state":{"title":"State"},"messages":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Messages"},"tools":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Tools"},"context":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Context"},"forwardedProps":{"title":"Forwardedprops"}},"additionalProperties":true,"type":"object","required":["threadId","runId"],"title":"AguiProtocolRunInput","description":"Canonical AG-UI RunAgentInput accepted by POST /ag-ui.\n\nThe official AG-UI clients use camelCase on the wire. UML-MCP keeps the request\npermissive so newer optional protocol fields can pass through without breaking older\nserver versions."},"AguiRunRequest":{"properties":{"diagram_type":{"type":"string","minLength":1,"title":"Diagram Type","description":"Diagram type (class, sequence, mermaid, …)."},"code":{"type":"string","minLength":1,"title":"Code","description":"Diagram source code."},"output_format":{"type":"string","title":"Output Format","description":"Output format: svg, png, etc.","default":"svg"},"theme":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Theme","description":"Optional PlantUML theme."},"scale":{"type":"number","minimum":0.1,"title":"Scale","description":"SVG scale factor.","default":1.0},"run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Run Id","description":"Optional caller-supplied run id (auto-generated if omitted)."}},"type":"object","required":["diagram_type","code"],"title":"AguiRunRequest","description":"Input for an AG-UI diagram run (mirrors the ``generate_uml`` tool arguments)."},"AguiRunResponse":{"properties":{"run_id":{"type":"string","title":"Run Id"},"endpoint":{"type":"string","title":"Endpoint"},"events_url":{"type":"string","title":"Events Url"},"status":{"type":"string","title":"Status"}},"type":"object","required":["run_id","endpoint","events_url","status"],"title":"AguiRunResponse","description":"Response from POST /ag-ui/start: where to subscribe for events."},"DiagramRequest":{"properties":{"lang":{"type":"string","title":"Lang","description":"The language of the diagram like plantuml, mermaid, etc."},"type":{"type":"string","title":"Type","description":"The type of the diagram like class, sequence, etc."},"code":{"type":"string","minLength":1,"title":"Code","description":"The code of the diagram."},"theme":{"type":"string","title":"Theme","description":"Optional theme for the diagram.","default":""},"output_format":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Output Format","description":"Output format for the diagram (svg, png, etc.)","default":"svg"}},"type":"object","required":["lang","type","code"],"title":"DiagramRequest","example":{"code":"@startuml\nclass Demo {\n  +name : String\n}\n@enduml","lang":"plantuml","output_format":"svg","theme":"","type":"class"}},"DiagramResponse":{"properties":{"url":{"type":"string","title":"Url","description":"URL to the generated diagram."},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message","description":"A message about the diagram generation."},"playground":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playground","description":"URL to an interactive playground."},"local_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Local Path","description":"Local path to the diagram file."}},"type":"object","required":["url"],"title":"DiagramResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"KrokiEncodeRequest":{"properties":{"type":{"type":"string","title":"Type","description":"Diagram type (class, sequence, mermaid, d2, etc.)."},"code":{"type":"string","title":"Code","description":"Diagram source code."},"output_format":{"type":"string","title":"Output Format","description":"Output format: svg, png, or pdf.","default":"svg"},"theme":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Theme","description":"PlantUML theme (e.g. cerulean) or Mermaid theme (default, dark, forest, neutral, base). Ignored otherwise."}},"type":"object","required":["type","code"],"title":"KrokiEncodeRequest","description":"Request body for /kroki_encode: returns Kroki URL without writing to disk.","example":{"code":"@startuml\nclass A\n@enduml","output_format":"svg","type":"class"}},"KrokiEncodeResponse":{"properties":{"url":{"type":"string","title":"Url","description":"Kroki URL for the rendered diagram."},"playground":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playground","description":"Optional URL to an interactive editor when available."}},"type":"object","required":["url"],"title":"KrokiEncodeResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"tags":[{"name":"rest","description":"Diagram generation, encoding, and health endpoints."},{"name":"agui","description":"AG-UI (Agent-User Interaction Protocol) event streaming endpoints. Emit RUN_STARTED/TOOL_CALL_*/RUN_FINISHED events over SSE for inline, live diagram rendering in chat frontends."},{"name":"well-known","description":"Machine-readable manifests, MCP server card, and plugin metadata."},{"name":"openapi","description":"OpenAPI specification exports (JSON is also served by FastAPI at /openapi.json)."}]}