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): inline. url: stored for 24 hours; link, metadata.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. Changed6 schema fields changed
    • changedInput schema / properties / output / description
      Previous value: -"base64 (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."New value: +"base64 (default): inline. url: stored for 24 hours; link, metadata."
    • addedOutput schema / properties / file / properties / bytes / description
      Added value: +"Bytes."
    • addedOutput schema / properties / file / properties / content_type / description
      Added value: +"MIME type."
    • addedOutput schema / properties / file / properties / expires_at / description
      Added value: +"UTC expiry."
    • addedOutput schema / properties / file / properties / sha256 / description
      Added value: +"SHA-256."
    • addedOutput schema / properties / file / properties / url / description
      Added value: +"Public link."
  2. Added

TDQS

A4.2/5.0
Behavior5/5

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

Goes well beyond annotations: offline sandboxed browser with strict security and no network, Mermaid 11.4.1, typical latency 1-3 s, USD 0.003 price with no free tier, and the full failure surface (422 invalid_diagram with line number, 422 over 8,000x8,000 px, 413 for PNG over 8 MB, none charged). That is exactly the operational context an agent needs before spending money on a retry.

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-loaded with the action and output, then packed with limits, errors and pricing; nearly every clause carries information. Minor waste in restating the title ('Returns Mermaid diagram code drawn as an SVG or PNG file') and the terse backtick style makes it dense but still readable.

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?

An output schema exists, so return shape needn't be described, and the description still covers cost, latency, size caps, error codes and the url-vs-base64 retention difference. Nothing material is missing for correct invocation.

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%, so all five parameters are already documented, including enums for format, theme and output. The description largely restates the same option sets (svg|png, theme list, scale 1-4, url 24 h) rather than adding new semantics, 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) plus the concrete output forms (SVG or PNG file). No sibling in the list overlaps, so an agent can select it unambiguously from the name and first sentence alone.

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 the input being Mermaid source and the description notes format/theme/scale trade-offs (svg scalable vs png, scale for zoom, base64 vs 24h url). It never states when to prefer this over alternatives (e.g. make_qr_code or upload_file_get_link) or any preconditions/exclusions, leaving routing to inference.

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