render_mermaid
Render a Mermaid diagram definition and return the image with metadata.
The definition should be valid Mermaid syntax (e.g. flowchart, sequence, class, ER, state, or Gantt diagram).
Returns a list of content blocks: the rendered image plus a JSON text block with metadata including a mermaid.live edit link for opening the diagram in a browser editor.
Args:
definition: Mermaid diagram definition text.
filename: Output filename without extension.
format: Output format — "png" (default), "svg", or "pdf".
download_link: If True, return a temporary download URL path
(/images/{token}) that expires after 15 minutes; if
False, return inline image bytes. Defaults to True
(URL) — set DIAGRAMS_INLINE_DEFAULT=true on the
server to flip the default. SVG/PDF and PNGs larger
than the inline limit always use a download link.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | png | |
| filename | No | diagram | |
| definition | Yes | ||
| download_link | No |