Skip to main content
Glama

convert_diagram

Read-onlyIdempotent

Make Mermaid diagrams portable. Takes HTML containing blocks (or a raw Mermaid source) and returns the same document with every diagram pre-rendered to inline SVG and the Mermaid CDN runtime stripped. A CDN-backed diagram only renders if the reader can fetch and run the runtime; inline SVG needs neither, so the output survives offline readers, email clients, Notion/Confluence (which strip ), and PDF export. Rendering happens on our infrastructure; diagram content is not sent to any third party.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "convert_diagram"
  }
}

Input Schema

NameRequiredDescriptionDefault
htmlNoHTML document or fragment containing <div class="mermaid"> blocks. Mutually exclusive with mermaid_source.
themeNoMermaid theme. Default "default".
backgroundNo"transparent" (default), "white", or a hex color.
output_formatNoDefault "html". "svg" returns the raw inline SVG and requires mermaid_source.
mermaid_sourceNoA single raw Mermaid diagram source. Mutually exclusive with html.
inject_lightboxNoAdd click-to-enlarge overlay CSS+JS for small-text diagrams. Default false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior5/5

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

Beyond the annotations (readOnly, idempotent, non-destructive, closed-world), the description discloses what actually gets changed in the document (runtime stripped, diagrams inlined), where rendering occurs, and a privacy guarantee that diagram content is not sent to a third party. Those are exactly the facts an agent needs before sending sensitive document content.

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?

It is front-loaded with the core transformation in the first two sentences, and the rationale plus privacy note follow usefully. The middle sentence is long and slightly repetitive about CDN dependence, but nothing is truly wasted.

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?

With six optional parameters, no output schema, and rich annotations, the description covers input forms, output form, and the reason for the transformation. It omits any mention of size limits, failure modes for invalid Mermaid syntax, or how multiple diagrams are handled, which are the only meaningful gaps.

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% with enums on theme and output_format, so the schema already documents every parameter precisely. The description reinforces the html-vs-mermaid_source duality and the SVG output mode, but adds no syntax or constraint detail the schema lacks; baseline 3 is appropriate.

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 names a specific transformation: it takes HTML containing `<div class="mermaid">` blocks (or a raw Mermaid source) and returns the same document with diagrams pre-rendered to inline SVG and the CDN runtime stripped. That is a concrete verb+resource+output, and it is clearly distinguishable from siblings such as describe_diagram or diagram_contrast.

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?

It clearly explains the motivating conditions: output must survive offline readers, email clients, Notion/Confluence (which strip `<script>`), and PDF export. It does not name an alternative tool or state when-not to use it, but the use case is unambiguous enough that an agent can route here confidently.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.