Skip to main content
Glama

convert_diagram_format

Converts diagram code between formats such as Mermaid, PlantUML, and Python Diagrams, enabling reuse of existing diagrams across supported diagramming tools.

Instructions

Convert a diagram from one format to another.

Args:
    diagram_code: Existing diagram code to convert
    from_format: Source format (e.g., "mermaid", "plantuml")
    to_format: Target format (e.g., "mermaid", "plantuml", "python_diagrams")
    diagram_type: Type of diagram ("sequence", "flowchart", "class")

Returns:
    Dictionary with converted diagram code

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_code": "<diagram_code>",
      "from_format": "<from_format>",
      "to_format": "<to_format>",
      "diagram_type": "<diagram_type>"
    },
    "name": "convert_diagram_format"
  }
}

Input Schema

NameRequiredDescriptionDefault
to_formatYes
from_formatYes
diagram_codeYes
diagram_typeYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.2/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden. It says a dictionary with converted code is returned, but never states what happens on unsupported or lossy conversions, whether conversion can fail, or whether output is semantically equivalent to the input.

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?

The summary sentence is front-loaded and the Args/Returns block is compact with no filler. It is docstring-style rather than prose, but every line carries information.

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 the Returns line is redundant but harmless. For a four-required-parameter, no-annotation tool, the definition is adequate but leaves gaps: no supported format matrix, no error behavior, and no indication of whether diagram_type must match the source format.

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% and the schema provides only bare titles, so the Args block does real work by giving example values for all four parameters, including 'python_diagrams' for to_format and 'sequence'/'flowchart'/'class' for diagram_type. However, the lists are non-exhaustive ('e.g.') and no constraints or valid combinations are defined.

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 opens with a specific verb+resource: 'Convert a diagram from one format to another', which distinguishes it from the generate_* siblings that create diagrams from scratch. It doesn't name any sibling explicitly, but the conversion framing is unambiguous.

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?

The use case is implied by the purpose: you have existing diagram code and want a different format. There is no explicit when-to-use guidance, no statement about which format pairs are supported, and no routing to get_diagram_capabilities to discover valid conversions.

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