Skip to main content
Glama

generate_diagram

Generates sequence, flowchart, class, or architecture diagrams from natural-language descriptions and returns diagram code for documentation and analysis.

Instructions

Universal diagram generator - automatically creates the appropriate diagram type.

Args:
    description: Natural language description of what to diagram
    diagram_type: Type of diagram - "sequence", "flowchart", "class", or "architecture"
    output_format: Output format (varies by diagram type)
    title: Optional custom title

Returns:
    Dictionary with generated diagram code and metadata

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": {
      "description": "<description>",
      "diagram_type": "<diagram_type>"
    },
    "name": "generate_diagram"
  }
}

Input Schema

NameRequiredDescriptionDefault
titleNo
descriptionYes
diagram_typeYes
output_formatNomermaid

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.9/5.0
Behavior2/5

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

No annotations exist, so the description carries the full burden. It discloses only that the output is a dictionary of diagram code plus metadata and that accepted formats vary by diagram type; it says nothing about whether anything is written to disk, whether calls are side-effect free, which formats are valid for which type, or how invalid type/format combinations fail.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The Args/Returns layout is easy to scan and front-loads the one-line purpose. The opening claim of automatic type selection conflicts with the required diagram_type parameter, and the Returns block restates information already available in the output schema, so a few sentences do not earn their place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return-value detail is not required. Still, for a four-parameter dispatcher sitting alongside eight related diagram tools, the definition omits format-per-type mapping, error behavior, and any routing rule telling the agent when to use this versus the specialized generators.

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 coverage is 0%, so compensation is required. The description does add real value by listing the four valid diagram_type values, which the schema does not enumerate, and by clarifying that title is optional. However, output_format is described only as "varies by diagram type", giving no valid values, and description's expected level of detail is not characterized.

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?

States a specific verb and resource: it generates a diagram and enumerates the supported kinds ("sequence", "flowchart", "class", "architecture"). It never explains why an agent would pick this universal generator instead of the dedicated siblings generate_sequence_diagram / generate_flowchart / generate_class_diagram, so the boundary is left to inference.

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

Usage Guidelines2/5

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

There is no when-to-use or when-not-to-use guidance, despite several sibling tools that appear to do overlapping work (generate_diagram_code, convert_diagram_format, get_diagram_capabilities). The phrase "automatically creates the appropriate diagram type" even suggests no type input is needed, yet diagram_type is required — an unresolved tension the description does not address.

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