Skip to main content
Glama

render_diagram

Render ASCII/Unicode box diagrams as SVG or web pages while keeping every character in its exact cell; use it to convert text diagrams into visuals and resolve reported alignment hints.

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.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "diagram": "<diagram>"
    },
    "name": "render_diagram"
  }
}

Input Schema

NameRequiredDescriptionDefault
foldNoWith interactive: start with nodes at this depth folded
fontNoFont family to try first, e.g. JetBrains Mono
boxesNoPer box name: {link, tooltip, tint}. Links work on a web page or <object>, not in <img>
colorNoTint boxes by group and colour the arrows
namesNoPut data-name on each box, for the page's own CSS or scripts
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
tokensNoLook tuning: ink, bg, accent, neutral, hover, glow (#hex), hues, branch ([[#hex, #hex], ...]), stroke, font_size, flow_speed, flow_rest; colours under light/dark apply to one theme
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)
portableNoOne <text> per character, for design tools such as Inkscape or Figma (browsers don't need it)
highlightNoBox names to keep bright, with the lines between them; the rest dims. Names are box titles, as check_diagram reports them
interactiveNoTrees and mind maps fold when clicked (in a browser; as an image it is the full drawing)
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. Changed4 schema fields changedv1.18.0
    • addedInput schema / properties / boxes
      Added value: +{
      +  "description": "Per box name: {link, tooltip, tint}. Links work on a web page or <object>, not in <img>",
      +  "type": "object"
      +}
    • addedInput schema / properties / highlight
      Added value: +{
      +  "description": "Box names to keep bright, with the lines between them; the rest dims. Names are box titles, as check_diagram reports them",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedInput schema / properties / names
      Added value: +{
      +  "description": "Put data-name on each box, for the page's own CSS or scripts",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / tokens
      Added value: +{
      +  "description": "Look tuning: ink, bg, accent, neutral, hover, glow (#hex), hues, branch ([[#hex, #hex], ...]), stroke, font_size, flow_speed, flow_rest; colours under light/dark apply to one theme",
      +  "type": "object"
      +}
  2. Changed4 schema fields changedv1.17.0
    • addedInput schema / properties / fold
      Added value: +{
      +  "description": "With interactive: start with nodes at this depth folded",
      +  "type": "integer"
      +}
    • addedInput schema / properties / interactive
      Added value: +{
      +  "description": "Trees and mind maps fold when clicked (in a browser; as an image it is the full drawing)",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / portable
      Added value: +{
      +  "description": "One <text> per character, for design tools such as Inkscape or Figma (browsers don't need it)",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / preset / enum
      Previous value: -[
      -  "readme",
      -  "slides",
      -  "chat",
      -  "print",
      -  "dark",
      -  "page"
      -]New value: +[
      +  "readme",
      +  "slides",
      +  "chat",
      +  "print",
      +  "dark",
      +  "page",
      +  "explore"
      +]
  3. First observedv1.15.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does disclose the key behavior: it writes to output_path, returns a JSON report, and enumerates the status values (ok | warnings | self_check_failed | bad_input) with the remediation path for the warnings case. It omits whether an existing file at output_path is overwritten or what permissions/paths are valid, which is the main remaining risk for a write tool.

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?

Front-loads purpose, then return contract, then remediation, then parameter selection, then prerequisite — five dense sentences with no filler. Status values and the hint-naming convention are stated inline where they are immediately useful.

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 21-parameter tool with nested objects and no output schema, the description compensates well by explaining the report's status and summary fields and the warnings-to-hint loop. Gaps remain around overwrite behavior at output_path and any size or diagram-syntax limits, which matter given the write side effect.

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 86%, so the schema already explains nearly all 21 parameters including presets and tokens. The description adds only selection advice for 'preset' and confirms output_path is written (with markup returned when omitted); the remaining parameters — interactive, portable, highlight, repair — are left entirely to the schema.

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 an ASCII/Unicode box diagram as SVG (or a web page)") plus the defining constraint ("keeping every character in its exact cell"). The output forms named — .svg markup or an .html page — let an agent tell it apart from the check_diagram sibling 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 explicit workflow ordering ("Run check_diagram first on a new diagram") and a self-repair loop (apply each warning 'hint' and render again), plus parameter guidance ("Pick 'preset' from where the diagram is going"). It stops short of stating when not to use it — e.g. that rendering is unnecessary for validation-only tasks — but the sibling relationship is clear.

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