Skip to main content
Glama

generate_class_diagram

Convert a natural-language domain model into class diagram code in Mermaid, PlantUML, or Python Diagrams, with an optional title.

Instructions

Generate a class diagram from a domain model description.

Args:
    description: Natural language description of entities and their relationships
                Example: "User has name and email, User creates Orders, Order contains Products"
    output_format: Output format - "mermaid", "plantuml", or "python_diagrams" (default: "mermaid")
    title: Optional custom title for the class diagram

Returns:
    Dictionary with generated class 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>"
    },
    "name": "generate_class_diagram"
  }
}

Input Schema

NameRequiredDescriptionDefault
titleNo
descriptionYes
output_formatNomermaid

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full behavioral burden. It discloses the output formats, the default, and that a dictionary of code plus metadata is returned, but says nothing about whether generation is pure/side-effect-free, whether invalid formats error or fall back, or how malformed domain descriptions are handled.

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?

Front-loaded one-line purpose followed by a standard Args/Returns block; every line carries information and nothing is padded. The Returns section is redundant with the existing output schema, a minor waste.

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 three-parameter generation tool with an output schema already covering return values, the definition covers purpose, all parameter meanings, and the allowed formats. The only meaningful gap is the absence of any safety or failure-mode note, which matters more because no annotations exist.

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 0%, and the description does compensate well for the two substantive params — it gives a concrete example for description and enumerates the three accepted output_format values with a default, information absent from the schema. However, it omits that title is nullable/optional and gives no constraints on description length or structure, leaving the baseline at 3.

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 first line states a specific verb and resource: 'Generate a class diagram from a domain model description.' That distinguishes it from generate_sequence_diagram and generate_flowchart by artifact type, though it never explicitly contrasts with the broader generate_diagram sibling.

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

Usage Guidelines3/5

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

Usage is only implied by the artifact type — an agent can infer 'use this when you want a class diagram from a natural-language domain model.' There is no explicit when-to-use statement, no exclusion, and no routing guidance toward generate_diagram or convert_diagram_format when a different input form or output conversion is needed.

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