Generate Diagram
generate_umlRender diagram source code into an image and return a render link, Markdown embed, or saved file for documentation and chat use.
Instructions
Render diagram source into an image. Returns url (render link), playground (source editor), display_markdown (chat embed), content_base64/mime_type when bytes are fetched and local_path for a saved file. Prefer SVG in MCP Apps.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"diagram_type": "<diagram_type>",
"code": "<code>"
},
"name": "generate_uml"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Diagram source code in the syntax required by diagram_type. | |
| scale | No | SVG scale factor; ignored for non-SVG output. | |
| theme | No | Optional theme: PlantUML name (e.g. cerulean), Mermaid default/dark/forest/neutral/base, D2 default/dark, or light/dark/bw. | |
| output_dir | No | Optional local directory for the rendered file; omit on hosted deployments. | |
| diagram_type | Yes | Catalog key selecting the source language and renderer; discover keys with list_diagram_types. | |
| output_format | No | Image or document encoding to produce; consult the type’s formats from list_diagram_types. | svg |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | ||
| code | Yes | ||
| error | No | ||
| source | No | ||
| success | No | ||
| attempts | No | Renderers tried, in order. | |
| cache_hit | No | ||
| mime_type | No | ||
| render_ms | No | ||
| local_path | No | ||
| playground | No | ||
| inline_note | No | ||
| diagram_type | No | ||
| error_detail | No | Failed requests only: code, message, retryable, line, column, suggestion, diagram_type, backend. | |
| fallback_used | No | ||
| output_format | No | ||
| content_base64 | No | Inline preview | |
| inline_omitted | No | ||
| source_omitted | No | ||
| cache_lookup_ms | No | ||
| preview_resized | No | ||
| display_markdown | No |