Skip to main content
Glama

Re-render Diagram

rerender_diagram
Read-onlyIdempotent

Re-render a diagram from the viewer’s existing source using a chosen theme and output format, returning the rendered image and viewer links for display.

Instructions

Render the viewer’s diagram source again with the selected theme and format. Returns content_base64, mime_type, url, playground, and display_markdown. Hidden from the model; callable from ui://uml-mcp/diagram-viewer via tools/call.

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_type": "<diagram_type>",
      "code": "<code>"
    },
    "name": "rerender_diagram"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYesDiagram source text in the language selected by diagram_type, taken from the viewer’s previous render.
scaleNoSVG scale factor; ignored unless output_format is svg.
themeNoVisual style for the selected renderer; omit to use its default styling.
diagram_typeYesCatalog key selecting the source language and renderer for this diagram.
output_formatNopng (default), svg, or jpeg for the viewer.png

Output Schema

NameRequiredDescriptionDefault
urlNo
codeYes
errorNo
sourceNo
successNo
attemptsNoRenderers tried, in order: backend, ok, status, duration_ms, error_summary, error_code, retry_count.
cache_hitNo
mime_typeNo
render_msNo
local_pathNo
playgroundNo
inline_noteNo
diagram_typeNo
error_detailNoFailed requests only: code, message, retryable, line, column, suggestion, diagram_type, backend.
fallback_usedNo
output_formatNo
content_base64NoBounded inline preview (max 48,000 base64 characters); larger images use a resized PNG preview when possible.
inline_omittedNo
source_omittedNo
cache_lookup_msNo
preview_resizedNo
display_markdownNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.4.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, and non-destructive, so the safety profile is covered. The description adds genuinely non-obvious behavior: it operates on viewer state from a previous render and is UI-invoked rather than model-invoked. The enumerated return fields add little since an output schema exists, but the stateful nature is useful disclosure.

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?

Two short sentences, front-loaded with the action and followed by the calling constraint. The list of return fields is the only redundant portion given the output schema, but it is brief.

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 five-parameter tool with a full output schema and complete annotation coverage, the description supplies what structured fields cannot: that it re-renders viewer state and is invoked from the UI rather than the model. Little else is needed.

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 each parameter is already fully documented including defaults and enum-like values. The description only restates 'selected theme and format' without adding semantics such as how theme keys map to renderers, so baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: re-render the viewer's existing diagram source with a chosen theme and format. The word 'again' plus the reference to the viewer's prior render distinguishes it from the sibling generators (generate_uml, generate_uml_image), though no sibling is named explicitly.

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?

It clearly states the calling context ('Hidden from the model; callable from ui://uml-mcp/diagram-viewer via tools/call'), which tells the agent when this tool is appropriate rather than the generation siblings. It does not explicitly say when not to use it, so it stops short of a 5.

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