Skip to main content
Glama

Check Diagram Source

validate_uml
Read-onlyIdempotent

Validates diagram type, syntax, and format locally without rendering, returning errors, warnings, suggestions, and diagnostics. Enable strict checks for extra Mermaid/D2 validation.

Instructions

Validate diagram type, format, and syntax locally (no render). Returns valid, errors, warnings, suggestions, and diagnostics; prepared_code is normalized source and changes explains normalization. Set strict=true for extra Mermaid/D2 checks.

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_type": "<diagram_type>",
      "code": "<code>"
    },
    "name": "validate_uml"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYesDiagram source code to validate locally without rendering.
strictNoEnable additional syntax checks when supported.
diagram_typeYesCatalog key selecting the source language and renderer to check.
output_formatNoOutput format whose compatibility should be checked.svg

Output Schema

NameRequiredDescriptionDefault
validYes
errorsNo
strictNo
backendNo
changesNo
warningsNo
normalizedNo
diagnosticsNoseverity, code, message, line, column, suggestion.
suggestionsNo
diagram_typeNo
prepared_codeNo
corrected_codeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changedv1.4.0
    • addedInput schema / properties / code / description
      Added value: +"Diagram source code to validate locally without rendering."
    • addedInput schema / properties / diagram_type / description
      Added value: +"Catalog key selecting the source language and renderer to check."
    • addedInput schema / properties / output_format / description
      Added value: +"Output format whose compatibility should be checked."
    • addedInput schema / properties / strict / description
      Added value: +"Enable additional syntax checks when supported."
    • removedOutput schema / additionalProperties
      Removed value: -true
    • addedOutput schema / description
      Added value: +"Structured output for validate_uml."
    • addedOutput schema / properties
      Added value: +{
      +  "backend": {
      +    "type": [
      +      "string",
      +      "null"
      +    ]
      +  },
      +  "changes": {
      +    "items": {
      +      "type": "string"
      +    },
      +    "type": "array"
      +  },
      +  "corrected_code": {
      +    "type": [
      +      "string",
      +      "null"
      +    ]
      +  },
      +  "diagnostics": {
      +    "description": "severity, code, message, line, column, suggestion.",
      +    "items": {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    "type": "array"
      +  },
      +  "diagram_type": {
      +    "type": [
      +      "string",
      +      "null"
      +    ]
      +  },
      +  "errors": {
      +    "items": {
      +      "type": "string"
      +    },
      +    "type": "array"
      +  },
      +  "normalized": {
      +    "default": false,
      +    "type": "boolean"
      +  },
      +  "prepared_code": {
      +    "type": [
      +      "string",
      +      "null"
      +    ]
      +  },
      +  "strict": {
      +    "default": false,
      +    "type": "boolean"
      +  },
      +  "suggestions": {
      +    "items": {
      +      "type": "string"
      +    },
      +    "type": "array"
      +  },
      +  "valid": {
      +    "type": "boolean"
      +  },
      +  "warnings": {
      +    "items": {
      +      "type": "string"
      +    },
      +    "type": "array"
      +  }
      +}
    • addedOutput schema / required
      Added value: +[
      +  "valid"
      +]
  2. Changed4 schema fields changedv1.3.1
    • removedInput schema / properties / code / description
      Removed value: -"Diagram source text."
    • removedInput schema / properties / diagram_type / description
      Removed value: -"Same as generate_uml (see uml://types)."
    • removedInput schema / properties / output_format / description
      Removed value: -"Intended output format (default svg); must be allowed for the type."
    • removedInput schema / properties / strict / description
      Removed value: -"When True, apply extra Mermaid/D2 checks (no extra PlantUML rules)."
  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 declare readOnly, idempotent, closed-world, non-destructive, so the safety profile is covered. The description adds real behavioral context beyond that: it confirms no rendering happens, names the diagnostic outputs, and explains that prepared_code is normalized source and changes explains normalization.

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 sentences, tightly packed, with the core action and the no-render constraint front-loaded. Every clause carries information; nothing is padding.

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?

With an output schema present, the description needn't enumerate return fields, yet it usefully clarifies the semantics of prepared_code and changes. Combined with the strict-flag note and the no-render guarantee, this is nearly complete for a 4-param, read-only validation tool; only explicit sibling routing is missing.

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 100%, so all four parameters are already documented, establishing a baseline of 3. The description does add one useful specificity beyond the schema — strict=true triggers extra Mermaid/D2 checks, versus the schema's vaguer 'additional syntax checks when supported' — but the other parameters get no extra meaning.

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+resource+scope: 'Validate diagram type, format, and syntax locally (no render).' The '(no render)' qualifier cleanly separates it from generate_uml/generate_uml_image/rerender_diagram siblings, so an agent can choose without opening a schema.

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: 'locally (no render)' suggests a pre-render check, but the description never says when to call this instead of generate_uml or rerender_diagram, nor whether it is a prerequisite. Adequate but leaves routing inference to the agent.

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