Skip to main content
Glama

Check an existing payment file

check_payment_file
Read-onlyIdempotent

Validate existing pain.001 or pain.008 payment XML against XSD, cross-element rules, scheme profiles, and Schematron presets, returning all errors and warnings together.

Instructions

Check an existing pain.001 or pain.008 file, as pain001 check does.

Use this on a payment file that already exists (one a bank returned,
another system wrote, or an earlier run produced) to learn whether it
is valid and why not. ``validate_records`` checks rows before
generation; this checks the XML itself: its message type's XSD, the
cross-element rules of the message definition, and the scheme
profiles and Schematron preset asked for. Every rung runs, so all
problems come back at once.

Delegates to :func:`pain001.check.check_document`.

Args:
    xml_content: The document as XML text.
    scheme: Scheme profiles, comma-separated, or ``None``.
    schematron: A Schematron preset, or ``None``.

Returns:
    ``{"message_type", "passed", "errors", "warnings", "rungs",
    "findings": [{"rung", "rule", "severity", "message",
    "location"}, ...]}``, or ``{"error": ...}`` when the document
    cannot be checked (not a bundled pain.001 or pain.008, a DTD,
    too large, an unknown scheme or preset) or the installed
    pain001 has no checker.

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": {
      "xml_content": "<xml_content>"
    },
    "name": "check_payment_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
schemeNoOptional payment-scheme rulebook profile to enforce, or several joined by commas. One of 'ae-uaefts', 'anti-duplicate', 'cbpr-cross-border', 'ch-domestic', 'ch-sepa', 'de-axz', 'de-ccu', 'hk-fps', 'my-duitnow', 'purpose-mandate-ae', 'purpose-mandate-gb', 'purpose-mandate-hk', 'purpose-mandate-my', 'purpose-mandate-qa', 'qa-qatch', 'se-bankgiro', 'sepa-b2b', 'sepa-inst', 'sepa-sct', 'sepa-sdd', 'sg-fast', 'uk-bacs', 'uk-bacs-dd', 'uk-chaps', 'uk-fps', 'us-ach', 'us-rtp', 'us-wire', 'xborder-ct'. Omit to skip scheme-specific rulebook validation.
schematronNoOptional Schematron rulebook preset: one of cbpr, cbpr+, cbpr-plus, epc-sepa, fednow, sepa, sepa-sct, swift. A path is not accepted.
xml_contentYesThe full pain.001 or pain.008 document as XML text (not a file path), at most 10 MiB.

Output Schema

NameRequiredDescriptionDefault
errorNo
rungsNo
errorsNo
passedNo
findingsNo
warningsNo
message_typeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.0.84

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already cover the read-only/idempotent safety profile, so the description is free to add real behavioral detail: the three validation rungs, the guarantee that all rungs run so all problems surface at once, and the delegation to `pain001.check.check_document`. It also enumerates failure modes (not a bundled message type, DTD, too large, unknown scheme or preset, missing checker) — strong disclosure, though it stops short of rate limits or handling behavior for very large inputs beyond the size cap.

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 prose is front-loaded and dense: purpose, when to use, what each validation rung means, then error semantics. The docstring-style Args and Returns blocks are partially redundant against a 100%-covered schema and an existing output schema, costing some efficiency but not clarity.

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?

For a three-parameter read-only validator, the description covers scope, the validation pipeline, the all-at-once error guarantee, and the exact conditions that produce an error object instead of findings. Nothing an agent needs in order to call it correctly or interpret a failure 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% and the schema already enumerates every scheme, preset, and the XML text format, so the description's Args block largely restates what is structured. The parenthetical 'A path is not accepted' for schematron and 'comma-separated, or None' add minor framing but nothing the schema lacks.

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?

Opens with a specific verb+resource (check a pain.001 or pain.008 file) tied to a concrete analogue (`pain001 check`), and immediately distinguishes it from `validate_records` by stating that this checks the XML itself rather than pre-generation rows.

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?

Gives explicit when-to-use conditions (a bank-returned file, a file another system wrote, output of an earlier run) and names the alternative, `validate_records`, along with the boundary that selects it. The agent does not have to infer which of the two validators to call.

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