Skip to main content
Glama

Generate Diagram Batch

generate_uml_batch
Idempotent

Render multiple UML and other diagrams in one batch call, isolating per-item failures so the remaining diagrams still generate.

Instructions

Render several diagrams in one call; a failed item does not stop the others. Inline previews share one 48k budget; later items load when opened.

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": {
      "items": "<items>"
    },
    "name": "generate_uml_batch"
  }
}

Input Schema

NameRequiredDescriptionDefault
itemsYesDiagrams, in result order.
output_dirNoOptional local directory for the rendered files; omit on hosted deployments.

Output Schema

NameRequiredDescriptionDefault
errorNo
resultsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv1.4.1
    • changedInput schema / properties / items / items / properties / output_format / enum
      Previous value: -[
      -  "svg",
      -  "png",
      -  "pdf",
      -  "jpeg",
      -  "txt",
      -  "base64",
      -  "html"
      -]New value: +[
      +  "svg",
      +  "png",
      +  "pdf",
      +  "jpeg",
      +  "txt",
      +  "base64",
      +  "html",
      +  "tsx"
      +]
    • changedOutput schema / properties / results / items / properties / attempts / description
      Previous value: -"Renderers tried, in order: backend, ok, status, duration_ms, error_summary, error_code, retry_count."New value: +"Renderers tried, in order."
    • changedOutput schema / properties / results / items / properties / content_base64 / description
      Previous value: -"Bounded inline preview (max 48,000 base64 characters); larger images use a resized PNG preview when possible."New value: +"Inline preview"
  2. Changed10 schema fields changedv1.4.0
    • addedInput schema / properties / items / description
      Added value: +"Diagrams, in result order."
    • changedInput schema / properties / items / items / additionalProperties
      Previous value: -trueNew value: +false
    • addedInput schema / properties / items / items / properties
      Added value: +{
      +  "code": {
      +    "maxLength": 500000,
      +    "minLength": 1,
      +    "type": "string"
      +  },
      +  "diagram_type": {
      +    "minLength": 1,
      +    "type": "string"
      +  },
      +  "output_format": {
      +    "enum": [
      +      "svg",
      +      "png",
      +      "pdf",
      +      "jpeg",
      +      "txt",
      +      "base64",
      +      "html"
      +    ]
      +  },
      +  "scale": {
      +    "minimum": 0.1,
      +    "type": "number"
      +  },
      +  "theme": {
      +    "type": "string"
      +  }
      +}
    • addedInput schema / properties / items / items / required
      Added value: +[
      +  "diagram_type",
      +  "code"
      +]
    • addedInput schema / properties / items / maxItems
      Added value: +20
    • addedInput schema / properties / items / minItems
      Added value: +1
    • addedInput schema / properties / output_dir / description
      Added value: +"Optional local directory for the rendered files; omit on hosted deployments."
    • removedOutput schema / additionalProperties
      Removed value: -true
    • addedOutput schema / description
      Added value: +"Structured output for generate_uml_batch."
    • addedOutput schema / properties
      Added value: +{
      +  "error": {
      +    "type": [
      +      "string",
      +      "null"
      +    ]
      +  },
      +  "results": {
      +    "items": {
      +      "description": "One indexed item returned by generate_uml_batch (a DiagramResult plus its index).",
      +      "properties": {
      +        "attempts": {
      +          "anyOf": [
      +            {
      +              "items": {
      +                "additionalProperties": true,
      +                "type": "object"
      +              },
      +              "type": "array"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "description": "Renderers tried, in order: backend, ok, status, duration_ms, error_summary, error_code, retry_count."
      +        },
      +        "cache_hit": {
      +          "type": [
      +            "boolean",
      +            "null"
      +          ]
      +        },
      +        "cache_lookup_ms": {
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        },
      +        "code": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "content_base64": {
      +          "anyOf": [
      +            {
      +              "maxLength": 48000,
      +              "type": "string"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "description": "Bounded inline preview (max 48,000 base64 characters); larger images use a resized PNG preview when possible."
      +        },
      +        "diagram_type": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "display_markdown": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "error": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "error_detail": {
      +          "anyOf": [
      +            {
      +              "additionalProperties": true,
      +              "type": "object"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "description": "Failed requests only: code, message, retryable, line, column, suggestion, diagram_type, backend."
      +        },
      +        "fallback_used": {
      +          "type": [
      +            "boolean",
      +            "null"
      +          ]
      +        },
      +        "index": {
      +          "type": "integer"
      +        },
      +        "inline_note": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "inline_omitted": {
      +          "type": [
      +            "boolean",
      +            "null"
      +          ]
      +        },
      +        "local_path": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "mime_type": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "output_format": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "playground": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "preview_resized": {
      +          "type": [
      +            "boolean",
      +            "null"
      +          ]
      +        },
      +        "render_ms": {
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        },
      +        "source": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "source_omitted": {
      +          "type": [
      +            "boolean",
      +            "null"
      +          ]
      +        },
      +        "success": {
      +          "type": [
      +            "boolean",
      +            "null"
      +          ]
      +        },
      +        "url": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        }
      +      },
      +      "required": [
      +        "index"
      +      ],
      +      "type": "object"
      +    },
      +    "type": "array"
      +  }
      +}
  3. First observedv1.3.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already communicate non-read-only, open-world, idempotent, non-destructive behavior. The description adds meaningful operational details: failed items do not halt the batch, inline previews share a 48k budget, and later items load when opened.

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?

Two compact sentences, front-loaded with the core batch operation and followed by the most important behavioral caveats. No redundant or ceremonial wording.

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?

Given the full schema and output schema, the description covers the batch semantics and key failure/preview behavior an agent needs. It stops short of explicitly routing between this and the single-diagram siblings, but the core invocation context is complete.

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 the schema already documents items, diagram fields, and output_dir. The description adds no parameter-specific format or constraint details beyond the 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?

States a specific verb and resource: render several diagrams in one call. The batch framing and partial-failure behavior clearly distinguish it from single-diagram siblings such as generate_uml and generate_uml_image.

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 phrase 'several diagrams in one call' implies when this tool is appropriate, but it does not explicitly name alternatives or state when not to use it. Guidance is usable but relies on inference.

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