Skip to main content
Glama

render_diagram

Convert ASCII/Unicode box diagrams to SVG or HTML with exact cell alignment. Includes layout verification and repair for misaligned diagrams.

Instructions

Render an ASCII/Unicode box diagram as SVG (or a web page), keeping every character in its exact cell. Writes output_path and returns a JSON report: read 'status' (ok | warnings | self_check_failed | bad_input) and 'summary'. For warnings, apply each 'hint' (it names the row/col to fix) and render again. Pick 'preset' from where the diagram is going. Run check_diagram first on a new diagram.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fontNoFont family to try first, e.g. JetBrains Mono
colorNoTint boxes by group and colour the arrows
styleNo
themeNo
titleNoAccessible title stored in the output
widthNoScale the output to this width in pixels
accentNoAccent colour for arrows and animation, e.g. #0969da
presetNoreadme: GitHub/docs, animated, follows dark mode · slides · chat · print · dark · page: a web page that reveals as you scroll (needs a .html path)
repairNoFix typical misalignment first (ragged walls, drifting connectors, short arrows); the fixed text is in report.repair.text
squareNoSquare box corners
animateNo
diagramYesThe diagram as plain text with real line breaks (a markdown code block is fine). Boxes: +--+ / | | / +--+ or ┌─┐ │ │ └─┘. Arrows end in v ^ < > or ▼ ▲ ▶ ◀ touching (or one space from) the box they point at.
describeNoAlso return boxes and edges (which box each arrow connects)
output_pathNoFile to write: .svg, or .html for a web page. Prefer an absolute path. Omit to get the markup back.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.15.0

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden and does well: it discloses file-writing side effects ('Writes output_path'), the exact JSON report structure ('status' with its four possible values, plus 'summary'), and the hint/repair mechanism. The only gap is not stating whether an existing output_path file is overwritten or whether rendering is destructive to input.

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?

Four sentences, each earning its place: purpose, behavior, warning-handling workflow, and sibling routing. Purpose is front-loaded. It is compact for a 14-parameter tool and avoids redundancy with the schema.

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 complex tool with 14 parameters, no output schema, and no annotations, the description covers the critical workflow well: return format, status values, hint loop, and preset selection. It doesn't explain every parameter, but the schema covers 79% of them and the core rendering/checking loop is fully specified.

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 79%, so the schema already documents most parameters in detail (preset enums with platform notes, output_path formats, diagram syntax). The description adds workflow-level context (pick preset by destination, run check first) but adds little param-level semantics beyond what the schema provides, so the 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?

States a specific verb ('Render'), resource ('ASCII/Unicode box diagram'), and output format ('as SVG (or a web page)'), plus a precise constraint ('keeping every character in its exact cell'). This clearly differentiates it from the sibling check_diagram, whose purpose is validation, not rendering.

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?

Explicitly directs the agent to 'Run check_diagram first on a new diagram', naming the alternative and the precondition that selects it. It also gives concrete workflow guidance for post-render handling ('For warnings, apply each hint... and render again') and parameter selection ('Pick preset from where the diagram is going'). Nothing is left to inference.

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

Deploy Server

Other Tools