Skip to main content
Glama

render_diagram

Read-only

Render a mingrammer/diagrams Python snippet to PNG and return the image.

The code must be a complete Python script using from diagrams import ... imports and a with Diagram(...) context manager block.

Use search_nodes to verify node names and get correct import paths before writing code. Read the diagrams://reference/diagram, diagrams://reference/edge, and diagrams://reference/cluster resources for constructor options and usage examples.

Args: code: Full Python code using the diagrams library. filename: Output filename without extension. format: Output format — "png" (default), "svg", or "pdf". download_link: If True, return a temporary download URL path (/images/{token}) that expires after 15 minutes; if False, return inline image bytes. Defaults to True (URL) — set DIAGRAMS_INLINE_DEFAULT=true on the server to flip the default. SVG/PDF and PNGs larger than the inline limit always use a download link.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes
formatNopng
filenameNodiagram
download_linkNo

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the readOnlyHint annotation, the description discloses critical behavior: the code must be a complete script with a context manager, output format options and defaults, and the download_link behavior including expiration and size limits. This extra context helps the agent anticipate side effects and output characteristics.

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?

The description is well-structured with a concise opening, a prerequisite paragraph, and a clear Args list. Every sentence provides necessary information; no filler. It is appropriately sized for a tool with 4 parameters and no schema descriptions.

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 lack of an output schema, the description adequately explains return values (inline bytes vs. download URL) and includes references for construction options. It covers prerequisites, defaults, and edge cases (SVG/PDF always use download link), making it complete for an agent to invoke correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Despite 0% schema description coverage, the Args section fully explains each parameter: code (complete Python script), filename (no extension), format (enum with default), and download_link (behavior, default, env-var override). This adds significant meaning beyond the raw 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?

The description opens with a specific verb+resource: 'Render a mingrammer/diagrams Python snippet to PNG and return the image.' This clearly distinguishes it from sibling render tools like render_mermaid and render_plantuml by specifying the exact library and output format.

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?

The description provides clear guidance on prerequisites ('must be a complete Python script using from diagrams import ...'), suggests using search_nodes to verify node names, and points to reference resources. It does not explicitly state when NOT to use this tool versus alternatives, but the context is clear from the library-specific wording.

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.

TDQS

A4.6/5.0
Disambiguation5/5

Each tool serves a distinct purpose: browsing (list_providers, list_services, list_nodes, search_nodes), equivalence lookup (find_equivalent, list_categories), and rendering in three different syntaxes (render_diagram, render_mermaid, render_plantuml). No two tools overlap in function, and descriptions clearly differentiate when to use each.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern with lowercase snake_case: list_* for browsing, render_* for output generation, find_equivalent, and search_nodes. The pattern is predictable and aids agent understanding.

Tool Count5/5

With 9 tools, the server is well-scoped: 4 browsing tools, 2 equivalence tools, and 3 rendering tools cover the diagram creation workflow without bloat. Each tool earns its place.

Completeness5/5

The tool surface supports the full workflow: discover providers/services/nodes, search for equivalent roles, and render diagrams in Python, Mermaid, or PlantUML. No obvious gaps exist for the stated purpose.