Skip to main content
Glama

Diagram Rendering (Mermaid)

diagram_render
Read-only

Render Mermaid diagram code to SVG and/or PNG: flowchart, sequence, class, state, ER, gantt, pie, mindmap, timeline and more. Invalid syntax returns HTTP 400 with the Mermaid parse error (not charged), so an agent can fix and retry. Params: code (Mermaid source, required), format (svg default, png or both), theme (default, dark, neutral, forest, base), width (200 to 4000, default 1200), background. Price: $0.01 USDC per call, paid inside this MCP call via x402 (USDC on Base, Solana, Polygon or Arbitrum). x402 MCP clients such as @x402/mcp pay automatically. Free sample: call with the example input {"code":"flowchart LR\n A[Agent] -->|HTTP 402| B(agentsvc.io)\n B --> C{Paid?}\n C -->|yes| D[JSON result]","format":"svg"}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesMermaid diagram source
themeNodefault
widthNo
formatNosvg
backgroundNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.5/5.0
Behavior5/5

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

Annotations (readOnlyHint, destructiveHint=false, openWorldHint) cover the safety profile, and the description goes well beyond them by disclosing error behavior (HTTP 400, not charged on failure), pricing ($0.01 USDC), the x402 payment flow, accepted chains, and client behavior. This is rich behavioral context an agent needs before calling a paid, open-world tool.

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?

Front-loads the core action and diagram types first, then error/payment/param details, and every sentence adds real value. It is somewhat dense with pricing and sample content, but nothing is gratuitous.

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 5-param, no-output-schema tool with low schema coverage, the description supplies the missing parameter meaning, error semantics and cost model, so an agent has enough to invoke it correctly. Minor gaps are the unexplained 'background' param and the absence of an explicit return-shape statement beyond the sample's 'JSON result'.

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

Parameters4/5

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

Schema description coverage is only 20% (only 'code' is documented in-schema), so the description carries the burden and mostly succeeds: it explains code, format (svg/png/both), theme values, width range (200-4000, default 1200) and background. 'background' is listed but not explained, leaving a small gap.

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 to SVG and/or PNG') and enumerates the supported diagram types, which clearly distinguishes it from the sibling chart_render. An agent can immediately tell what this produces without opening the schema.

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?

Gives clear operational context: invalid syntax returns 400 with the parse error (not charged), so the agent can fix and retry, plus a free sample call. It doesn't name when to prefer an alternative sibling (e.g. chart_render) or exclusions, so it falls short of the 5 bar.

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.

Resources