Skip to main content
Glama

Validate XML against XSD

validate_xml
Read-onlyIdempotent

Validates a raw ISO 20022 pacs XML document against the bundled XSD schema for a specified message type, returning whether the document is valid.

Instructions

Validate a raw XML string against a message type's bundled XSD.

Use this to check an externally produced XML document against the official
ISO 20022 schema. To generate a document that is already XSD-validated,
use ``generate_message`` instead.

Returns ``{"message_type": str, "is_valid": bool}``, or ``{"error":
...}`` for an unsupported type or DTD entities; a bad year is invalid.

Args:
    message_type: A supported ISO 20022 pacs message type.
    xml: The raw XML document to validate.

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": {
      "message_type": "<message_type>",
      "xml": "<xml>"
    },
    "name": "validate_xml"
  }
}

Input Schema

NameRequiredDescriptionDefault
xmlYesA raw ISO 20022 XML document to validate against the bundled XSD schema for the given message type.
message_typeYesA supported ISO 20022 pacs message type, e.g. 'pacs.008.001.08' FI-to-FI Customer Credit Transfer. Must be exactly one of: 'pacs.002.001.12', 'pacs.003.001.09', 'pacs.004.001.11', 'pacs.007.001.11', 'pacs.008.001.01', 'pacs.008.001.02', 'pacs.008.001.03', 'pacs.008.001.04', 'pacs.008.001.05', 'pacs.008.001.06', 'pacs.008.001.07', 'pacs.008.001.08', 'pacs.008.001.09', 'pacs.008.001.10', 'pacs.008.001.11', 'pacs.008.001.12', 'pacs.008.001.13', 'pacs.009.001.10', 'pacs.010.001.05', 'pacs.028.001.05' (see list_message_types).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, so the safety profile is covered. The description adds real value beyond that: the exact return shape, the error case for unsupported types or DTD entities, and the non-obvious note that a bad year counts as invalid rather than an error.

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?

Front-loads what it does, then the disambiguation, then the return contract, then args. Every sentence earns its place with no filler.

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

Completeness5/5

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

No output schema exists, and the description supplies the return contract including error shape, which is exactly the missing piece. Nothing an agent needs to invoke it correctly is absent.

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% and the enum is fully documented in the schema, so the description's Args section largely restates it. It does add the edge-case meaning that an unsupported message_type yields an error, but no format guidance for the XML string itself.

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 ('Validate a raw XML string against a message type's bundled XSD') and names the sibling it is not (generate_message). An agent can immediately tell this apart from parse_message or generate_message.

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

Usage Guidelines5/5

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

Explicitly says when to use it ('check an externally produced XML document') and routes the alternative case to generate_message for XSD-validated generation. The when/when-not pair is unambiguous.

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