Skip to main content
Glama

pdfpeek: render Mermaid diagram code to an SVG or PNG image

render_mermaid
Idempotent

pdfpeek: Render Mermaid diagram code to an SVG or PNG image. Returns Mermaid diagram code drawn as an SVG or PNG file in an offline sandboxed browser: format svg | png, theme (default, dark, forest, neutral, base), scale 1-4 for PNG (default 2, sharp when zoomed). File base64 in file (output=url gives a 24 h link). A syntax error is a 422 invalid_diagram with the line number; over 8,000 x 8,000 px a 422, a PNG over 8 MB a 413 (none charged). Mermaid 11.4.1, strict security, no network. Typically 1-3 s. Price: USD 0.003. No free tier.

Input Schema

NameRequiredDescriptionDefault
codeYesMermaid diagram source (flowchart, sequence, class, state, ER, gantt, pie, git graph, mindmap, timeline and the other types of mermaid 11.4.1), 1-20,000 characters. Fenced ``` lines are not needed. A syntax error is a 422 with the line number.
scaleNoPNG pixel density, 1-4 (default 2, sharp when zoomed). Lowered automatically so the longest side stays at 8,000 px. Ignored for svg.
themeNoMermaid theme. dark gives a dark background in PNG; the others a white one.default
formatNosvg (default, scalable, plain text labels) or png.svg
outputNobase64 (default): the file comes back inline as base64. url: the file is stored for 24 hours and the reply carries a download link (url, expires_at, bytes, content_type, sha256) instead of the base64, which keeps the file out of your context window.base64

Output Schema

NameRequiredDescriptionDefault
fileNo
errorNoOnly on an error result: an object {code, message}, or the reason string of an x402 PaymentRequired object.
scaleNo
themeNo
widthNo
formatNo
heightNo
operationNo
output_bytesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.4/5.0
Behavior5/5

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

Goes well beyond the annotations: it discloses the offline sandboxed browser, Mermaid 11.4.1, strict security with no network, typical 1-3 s latency, USD 0.003 pricing, and specific failure modes (422 invalid_diagram with line number, 8,000x8,000 px and 8 MB caps, 413). This is rich operational context the annotations do not carry.

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 purpose in the first clause, then packs constraints, errors, and pricing densely. Every clause carries information, though the run-on style with many parentheticals is slightly less scannable than ideal.

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

Completeness5/5

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

For a paid, rate-limited renderer, the description covers inputs, outputs, error codes, size limits, timing, and cost. An output schema exists, so return-value shape need not be re-explained, and nothing essential for correct invocation is missing.

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 baseline is 3. The description restates the same enum values and defaults the schema already documents (svg|png, theme list, scale 1-4 default 2) without adding new syntax or semantic detail.

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 (render) plus the exact resource (Mermaid diagram code) and the output artifact (SVG or PNG image). No sibling tool does this, and the agent can identify the action and its product immediately.

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 concrete format/theme/scale options and steers to output=url when the caller wants the file kept out of the context window, but it never states explicit when-to-use vs when-not conditions or names an alternative tool. Clear context, no exclusions.

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