render_mermaid_file
Reads a local .mmd or .mermaid file, validates the required diagram type, renders it as a high-resolution PNG, and saves it to the specified output path.
Instructions
Reads a local .mmd or .mermaid file, validates the mandatory diagram_type, renders it into a high-resolution PNG image, and writes the output file to disk.
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>",
"input_path": "<input_path>",
"output_path": "<output_path>"
},
"name": "render_mermaid_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scale | No | Resolution scale factor (default: 2 for sharp retina quality) | |
| 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 |
| input_path | Yes | Absolute or relative path to a local .mmd or .mermaid file to render | |
| output_path | Yes | Absolute or relative path where the rendered PNG image should be saved | |
| 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. |