Skip to main content
Glama

render_diagram

Render Mermaid diagram definitions to PNG, SVG, PDF, or editable draw.io files, outputting base64 or writing to disk.

Instructions

Render Mermaid diagram syntax into a PNG, SVG, or PDF — or convert it to an editable draw.io (.drawio) file. Returns the result as base64-encoded data (drawio: XML text), or writes it to output_path if given. drawio format supports flowcharts only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
themeNoVisual theme for the diagram.default
widthNoCanvas width in pixels (PNG only).
formatNoOutput format. Defaults to png. drawio produces an editable draw.io XML file (flowcharts only).png
pdfFitNoScale the PDF page to fit the diagram (PDF only).
syntaxYesMermaid diagram definition (e.g. flowchart, sequenceDiagram, etc.)
backgroundNoBackground colour (CSS colour string or "transparent").white
output_pathNoAbsolute file path to write the result to. When given, the file is written to disk and no base64 data is returned — useful for documents destined for printing or formal submission.
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description discloses important behaviors: returns base64-encoded data (or XML for drawio), writes to output_path when provided, and limits drawio to flowcharts. Yet it omits edge cases like error handling, file overwriting, or invalid syntax behavior, which keeps it from being more transparent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is exactly three sentences, each adding distinct value: the main function, the return/write behavior, and the drawio caveat. It is well-structured and front-loaded with the core purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given there is no output schema and no annotations, the description efficiently covers formats, return type, output_path behavior, and a format limitation. It is sufficient for an agent to invoke the tool correctly, though it could mention potential error conditions or overwrite behavior for full completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema covers all 7 parameters with descriptions, so the schema carries the primary semantics. The description adds a bit of extra context by explaining the base64/drawio XML return behavior and how output_path changes the response, but it doesn't significantly exceed what the schema already provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool renders Mermaid syntax into PNG, SVG, PDF, or an editable draw.io file. The verb 'Render' and specific output formats make the purpose unambiguous, even without sibling tools for comparison.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides useful usage context, such as using output_path for printing/form submission and noting drawio format supports flowcharts only. However, it doesn't explicitly mention when not to use the tool or compare to alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/tci-nebula/mermaid-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server