Skip to main content
Glama

Render diagram

render_diagram
Read-onlyIdempotent

Render Mermaid source with Line9's layout engine. Call this whenever you write or change Mermaid and the user should see the result. Flowcharts and sequence diagrams get Line9's layout; other Mermaid kinds are rendered with Mermaid's own layout and flagged as such. Returns a short verdict — kind, size, warnings, or a parse error with its line and column — plus an "Open in Line9" link. On a parse error, fix the named line and call again. Assistants that support MCP Apps show the diagram in a panel; there, do not paste the SVG or repeat the source in your reply. In an assistant with no panel (a terminal or editor), reply with the verdict line and the open_url link — that link is the only way the user sees the diagram. Write flowcharts as flowchart LR unless the user asks for top-to-bottom; chat panels are wide and short. No sign-in needed; renders carry a small Line9 mark unless the user is signed in to Line9 Pro. Set theme, orientation, spacing and legend in the source itself (line9: frontmatter; flowchart LR), never as arguments. This connector cannot publish or save. To publish, the user opens the diagram in Line9 (the open_url link) and publishes there — not with the Line9 CLI.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
planNoOpaque plan from a previous result (widget use). A hint only: skips the solve when it still fits the source.
sourceYesMermaid source. Optional YAML frontmatter is honoured — set it in the source, never as arguments: `title`, and a nested `line9:` block with `theme` (one of `boardroom`, `linen`, `blueprint`), `scale: { node, spacing }` and `flowchart: { legend: on | off }`. The flowchart direction directive is also honoured. Maximum 100000 characters.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
svgNo
pathNo
planNo
errorNo
widthNo
configNo
heightNo
sourceNo
statusYes
diagramNo
controlsNo
diagramsNo
open_urlNo
warningsNo
signed_inNo
truncatedNo
watermarkNo
edge_countNo
node_countNo
orientationNo
render_modeNo
stop_reasonNo
diagram_typeNo
engine_versionNo
schema_versionYes
fallback_reasonNo
mermaid_versionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already mark the tool read-only, non-destructive and idempotent; the description goes well beyond that by disclosing layout differences for diagram kinds, parse-error details (line/column), the Open in Line9 link, panel vs terminal rendering, sign-in/branding behavior, and the impossibility of publishing/saving. None of this contradicts the annotations.

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?

Dense but efficient: the core purpose and trigger come first, followed by output, failure handling, client differences, and constraints, with no filler or repeated schema text. The length is justified by the number of behavioral nuances an agent must know before invoking this tool.

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?

Given the complexity — custom layout, frontmatter options, panel vs terminal output, parse-error recovery, auth/branding, and publish limitations — the description is complete. It even covers the failure retry loop ('fix the named line and call again'), and the return-value burden is covered by the output schema plus the explicit verdict summary.

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 coverage is 100%, so the baseline is 3; the description adds real value by explaining that `plan` is an opaque hint from a prior result and by prohibiting style/theme arguments ('set ... in the source itself, never as arguments'). It also clarifies what frontmatter in `source` controls, which goes beyond the schema's property names.

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 source with Line9's layout engine' — and immediately distinguishes rendering from the get/list siblings. It also specifies what the call produces (verdict, link, panel rendering), so an agent can tell exactly what the tool does.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit trigger condition: 'Call this whenever you write or change Mermaid and the user should see the result.' It also states clear exclusions ('cannot publish or save', 'not with the Line9 CLI') and gives branch instructions for panel vs no-panel clients, so both tool choice and follow-up action are unambiguous.

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