Skip to main content
Glama

Parse pain.002 status report file

parse_pain002
Read-onlyIdempotent

Parse a pain.002 payment-status report XML file to extract per-transaction accepted/rejected statuses and reason codes from the bank's acknowledgement. Optionally validate against a pain.002 XSD.

Instructions

Parse a pain.002 payment-status report file on disk into structured data.

Use this to read the bank's acknowledgement of a submitted pain.001 —
the per-transaction accepted/rejected status and reason codes. Reads
``xml_file_path`` from the local filesystem. For the account statement
that later confirms booked entries, use ``parse_camt053`` instead.

Wraps :func:`pain001.parse_pain002_report`. When ``xsd_file_path`` is
provided, the document is first validated against that XSD; on a
schema or parse error the tool returns ``{"error": ...}`` rather than
raising.

Args:
    xml_file_path: Filesystem path to the pain.002 XML report.
    xsd_file_path: Optional path to a pain.002 XSD for upfront
        validation.

Returns:
    A dict with the group header and transaction statuses, or an
    ``{"error": ...}`` payload on failure.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xml_file_pathYesLocal filesystem path to the pain.002 payment-status report XML file to parse.
xsd_file_pathNoOptional local path to a pain.002 XSD; when given, the document is validated against it before parsing. Omit to skip schema validation.
Behavior4/5

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

Annotations already indicate readOnly, idempotent, non-destructive. Description adds specific error handling behavior (returns error on schema/parse failure), optional XSD validation, and that it reads from filesystem. No contradictions.

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?

Concise, well-structured with summary, usage, parameters, returns. Front-loaded with purpose and context. Every sentence provides necessary information without redundancy.

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?

Given low complexity (2 params, no enums, no nested objects) and full schema coverage, the description fully explains behavior, including optional validation and error returns. No gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema has 100% description coverage, so baseline is 3. Description adds value by explaining the effect of providing xsd_file_path (validation before parsing) and the return structure on failure, which aids correct invocation.

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?

The description clearly states the tool parses a pain.002 file into structured data, identifies the specific resource and action, and distinguishes it from the sibling parse_camt053 by specifying it handles payment-status reports while parse_camt053 handles account statements.

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 states when to use (to read bank's acknowledgement of pain.001) and when not (for account statements, use parse_camt053). Provides context about per-transaction status and reason codes.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sebastienrousseau/pain001-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server