render_mermaid_to_png
Converts Mermaid.js diagram syntax into a high-resolution PNG image for documentation or reports, validating the required diagram_type and returning keyword feedback for missing or invalid input.
Instructions
Renders Mermaid.js diagram syntax into a high-resolution PNG image. Requires an explicit diagram_type keyword (e.g. "usecase-beta", "swimlane-beta", "sequenceDiagram", "flowchart"). Rejects requests if diagram_type is missing or invalid, returning valid keyword feedback.
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>",
"mermaid_syntax": "<mermaid_syntax>"
},
"name": "render_mermaid_to_png"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scale | No | Resolution scale factor (default: 2 for sharp retina quality, use 1 for standard, 3 for ultra-crisp) | |
| theme | No | Visual theme for the Mermaid diagram: default, neutral, dark, forest, or base | default |
| width | No | Optional viewport width hint in pixels | |
| height | No | Optional viewport height hint in pixels | |
| background | No | Background color: "white", "transparent", or any CSS color code (e.g. "#1e1e2e") | white |
| output_path | No | Optional absolute or relative file path to save the resulting PNG image to disk | |
| diagram_type | Yes | Required diagram type keyword supported by the Mermaid v12.3.0 engine (e.g. "usecase-beta", "swimlane-beta", "sequenceDiagram", "flowchart", "classDiagram", "architecture", "gantt"). Call "get_supported_diagrams" to view all available keywords. | |
| mermaid_syntax | Yes | The Mermaid diagram syntax string to render into PNG (e.g. "usecase-beta\n actor User") |