Skip to main content
Glama

Parse camt.053 statement file

parse_camt053
Read-onlyIdempotent

Read a camt.053 bank-statement XML from a file path and return its header and entries; optionally validate against an XSD first. Returns an error payload on failure.

Instructions

Parse a camt.053 bank-statement XML file on disk into structured data.

Use this to read a bank's account statement (the reply that confirms
settlement) into a header + entry list. Reads ``xml_file_path`` from the
local filesystem. For the payment-status reply (accepted/rejected per
transaction) use ``parse_pain002`` instead; to validate a camt.053
string you already hold, this is not it — this tool needs a file path.

Wraps :func:`pain001.parse_camt053_statement`. 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 camt.053 XML statement.
    xsd_file_path: Optional path to a camt.053 XSD for upfront
        validation.

Returns:
    A compact dict with the statement header and entry list, or an
    ``{"error": ...}`` payload on failure.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xml_file_pathYesLocal filesystem path to the camt.053 bank-statement XML file to parse.
xsd_file_pathNoOptional local path to a camt.053 XSD; when given, the document is validated against it before parsing. Omit to skip schema validation.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
ibanNo
errorNo
entriesNo
currencyNo
statement_idNo
electronic_sequence_numberNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.0.71
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "description": "A parsed camt.053 statement, as the core library reports it.",
      +  "properties": {
      +    "currency": {
      +      "title": "Currency",
      +      "type": "string"
      +    },
      +    "electronic_sequence_number": {
      +      "title": "Electronic Sequence Number",
      +      "type": "string"
      +    },
      +    "entries": {
      +      "items": {
      +        "additionalProperties": true,
      +        "type": "object"
      +      },
      +      "title": "Entries",
      +      "type": "array"
      +    },
      +    "error": {
      +      "title": "Error",
      +      "type": "string"
      +    },
      +    "iban": {
      +      "title": "Iban",
      +      "type": "string"
      +    },
      +    "statement_id": {
      +      "title": "Statement Id",
      +      "type": "string"
      +    }
      +  },
      +  "title": "Camt053Result",
      +  "type": "object"
      +}
  2. Addedv0.0.60
  3. Removed
  4. Changed2 schema fields changedv0.0.56
    • addedInput schema / properties / xml_file_path / description
      Added value: +"Local filesystem path to the camt.053 bank-statement XML file to parse."
    • addedInput schema / properties / xsd_file_path / description
      Added value: +"Optional local path to a camt.053 XSD; when given, the document is validated against it before parsing. Omit to skip schema validation."
  5. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare readOnlyHint/idempotentHint, and the description adds meaningful behavior beyond that: optional XSD validation precedes parsing, errors are returned as an {"error": ...} payload rather than raised, and the wrapped function is identified. This gives an agent accurate expectations about side effects and failure modes.

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 description is front-loaded with purpose and tool-selection guidance, then gives error behavior and args in a standard structure. It is slightly redundant with the input schema in the Args block, but every major section earns its place and there is 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?

For a two-parameter read-only tool with rich annotations and an output schema, the description covers prerequisites (file path), optional validation semantics, error return shape, and the sibling alternative. Nothing an agent needs to decide whether and how to invoke it 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 description coverage is 100% and both parameters already have clear descriptions, so the baseline is 3. The description's Args block largely repeats the schema rather than adding new semantics; it does not materially deepen parameter understanding.

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 first sentence names a specific verb ('Parse'), a specific resource ('camt.053 bank-statement XML file on disk'), and the output ('structured data'). It explicitly distinguishes from parse_pain002 by contrasting statement reply vs payment-status reply, so an agent can select it correctly without inspecting sibling schemas.

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?

The description gives explicit when-to-use context: reading an account statement into a header + entry list. It names the alternative tool parse_pain002 for payment-status replies and warns that validating an already-held camt.053 string is not this tool's purpose because it requires a file path. This is strong routing guidance.

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