Skip to main content
Glama

render_mermaid

Converts Mermaid diagram code into local PNG images for visual inspection, so you can spot layout, overlap, and contrast issues and fix them through a render-inspect-render loop.

Instructions

Render Mermaid diagram code to PNG image locally using mmdc. Returns the rendered image for visual inspection. Use this for feedback loops: render -> inspect -> fix -> re-render.

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": {
      "mermaidCode": "<mermaidCode>"
    },
    "name": "render_mermaid"
  }
}

Input Schema

NameRequiredDescriptionDefault
scaleNoScale factor for higher resolution (1-5)
themeNoMermaid themedefault
mermaidCodeYesMermaid diagram code to render
backgroundColorNoBackground color (e.g. 'white', 'transparent', '#F0F0F0')white

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4/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: it discloses that rendering happens locally via mmdc and that an image is returned for inspection, which is genuinely useful. It does not say what happens on invalid Mermaid syntax, whether files are written to disk, or any size/timeout limits — meaningful gaps for a local subprocess-backed renderer.

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?

Three short sentences, front-loaded with the core action, that each contribute distinct information (what, output, usage pattern). No filler or redundancy.

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 a four-parameter, single-purpose tool with full schema coverage and no output schema, the description states the return value ('rendered image') and its intended workflow. The main omission is failure behavior on malformed diagram code, which an agent would benefit from knowing before calling.

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 coverage is 100%, with descriptions, defaults, and range/enum constraints for scale, theme, backgroundColor, and mermaidCode. The description adds no additional meaning about how these affect rendering, so the baseline 3 applies.

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?

States a specific verb and resource ('Render Mermaid diagram code'), the output format (PNG image), and the underlying mechanism ('locally using mmdc'). An agent knows exactly what this tool produces without opening the schema, and there are no siblings to disambiguate against.

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?

Provides an explicit usage pattern ('render -> inspect -> fix -> re-render'), which tells the agent this is meant for iterative visual verification rather than one-shot generation. It gives no when-not guidance, but with no sibling tools there is no alternative to route away from.

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

Deploy Server

Other Tools