Generate Diagram Image
generate_uml_imageRender diagram source code as an inline image for chat, returning a bounded preview plus render and playground links to inspect and share UML and other diagrams.
Instructions
Render a diagram as MCP ImageContent for chat with a bounded inline preview. Returns content_base64, mime_type, render and playground links. Fetches bytes even under URL-only. Large images use a PNG thumbnail 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_image"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Diagram source code in the syntax required by diagram_type. | |
| scale | No | SVG scale factor; ignored unless output_format is svg. | |
| theme | No | Optional theme: PlantUML name (e.g. cerulean), Mermaid default/dark/forest/neutral/base, D2 default/dark, or light/dark/bw. | |
| diagram_type | Yes | Catalog key selecting the source language and renderer; discover keys with list_diagram_types. | |
| output_format | No | Output format for the inline image; png (default), svg, or jpeg. | png |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | ||
| code | Yes | ||
| error | No | ||
| source | No | ||
| success | No | ||
| attempts | No | Renderers tried, in order: backend, ok, status, duration_ms, error_summary, error_code, retry_count. | |
| 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 | Bounded inline preview (max 48,000 base64 characters); larger images use a resized PNG preview when possible. | |
| inline_omitted | No | ||
| source_omitted | No | ||
| cache_lookup_ms | No | ||
| preview_resized | No | ||
| display_markdown | No |