Skip to main content
Glama

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

NameRequiredDescriptionDefault
scaleNoResolution scale factor (default: 2 for sharp retina quality, use 1 for standard, 3 for ultra-crisp)
themeNoVisual theme for the Mermaid diagram: default, neutral, dark, forest, or basedefault
widthNoOptional viewport width hint in pixels
heightNoOptional viewport height hint in pixels
backgroundNoBackground color: "white", "transparent", or any CSS color code (e.g. "#1e1e2e")white
output_pathNoOptional absolute or relative file path to save the resulting PNG image to disk
diagram_typeYesRequired 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_syntaxYesThe Mermaid diagram syntax string to render into PNG (e.g. "usecase-beta\n actor User")

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does disclose one real behavioral trait: invalid or missing diagram_type is rejected with valid keyword feedback rather than silently failing. It says nothing about writing to output_path (overwrite behavior, directory creation) or output size/limits, which are the risky aspects of an otherwise read-like render.

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

Conciseness4/5

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

Three short sentences, front-loaded with the core action and output format. The third sentence partially restates the second (diagram_type is required / requests are rejected if it is missing), so it is efficient but not maximally tight.

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?

For an 8-parameter tool with full schema coverage and no output schema, the description covers purpose, mandatory input, and error behavior adequately. The remaining gap is side-effect disclosure around output_path and any guidance on choosing between this and render_mermaid_file.

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?

Schema description coverage is 100%, so every parameter is already documented, and the description adds only the diagram_type keyword examples and the failure mode. That is a marginal gain over the schema, consistent with the baseline 3.

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

Purpose4/5

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

States a specific verb and resource chain: renders Mermaid.js syntax into a high-resolution PNG. The phrase 'diagram syntax' implicitly separates it from render_mermaid_file, but no sibling is named explicitly, so an agent must infer that distinction from the tool names alone.

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

Usage Guidelines3/5

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

Gives a clear precondition (diagram_type is mandatory) and points indirectly at get_supported_diagrams through the schema. It never says when to prefer this over render_mermaid_file or get_diagram_syntax_guide, leaving the routing decision implied by names.

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