Skip to main content
Glama

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

NameRequiredDescriptionDefault
scaleNoResolution scale factor (default: 2 for sharp retina quality)
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
input_pathYesAbsolute or relative path to a local .mmd or .mermaid file to render
output_pathYesAbsolute or relative path where the rendered PNG image should be saved
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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full behavioral burden. It usefully discloses the pipeline (read, validate mandatory diagram_type, render high-resolution PNG, write output) and that it is a filesystem-writing operation. It omits overwrite behavior when output_path already exists, failure modes for an invalid or unsupported diagram keyword, and any rendering-engine dependency or performance expectations.

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?

A single well-ordered sentence that front-loads the file read and proceeds through validation, rendering, and output. Nothing is redundant, though it is dense enough that the key differentiator (file-based vs. string-based rendering) is not surfaced as a distinct clause.

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

Completeness3/5

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

For an 8-parameter mutation tool with no annotations and no output schema, the description covers the workflow and where results land (output_path). It leaves out what happens on existing-file collision, how errors are surfaced, and the return shape, which an agent would need before calling this confidently.

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 the schema already documents all eight parameters including scale, theme, background, and the width/height hints. The description adds only that diagram_type is mandatory and validated, which the schema already conveys via the required list. Baseline 3 is appropriate when the schema does the heavy lifting.

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?

The description states a specific verb chain and resource: reads a local .mmd/.mermaid file, validates diagram_type, renders to PNG, and writes to disk. The file-in/file-out framing implicitly separates it from a string-to-image renderer, but it never names render_mermaid_to_png, so the sibling differentiation is left to inference.

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?

Usage is implied by 'Reads a local .mmd or .mermaid file' — an agent can infer this is the tool for diagram sources already on disk. However, there is no explicit when-to-use vs. render_mermaid_to_png guidance, nor any stated preconditions (e.g., the file must exist and contain a valid diagram).

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