Skip to main content
Glama

Parse camt.053 statement file

parse_camt053
Read-onlyIdempotent

Parses a camt.053 bank-statement XML file from a local path into structured statement headers and entries, with optional XSD validation and error responses for invalid files.

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:
    The first statement's header and entries, every statement under
    ``statements``, or an ``{"error": ...}`` payload on failure.

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_file_path": "<xml_file_path>"
    },
    "name": "parse_camt053"
  }
}

Input 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

NameRequiredDescriptionDefault
ibanNo
errorNo
entriesNo
currencyNo
statementsNo
statement_idNo
electronic_sequence_numberNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.0.84
    • changedOutput schema / description
      Previous value: -"A parsed camt.053 statement, as the core library reports it."New value: +"A parsed camt.053: the first statement's fields, and every one."
    • addedOutput schema / properties / statements
      Added value: +{
      +  "items": {
      +    "additionalProperties": true,
      +    "type": "object"
      +  },
      +  "title": "Statements",
      +  "type": "array"
      +}
  2. 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"
      +}
  3. Addedv0.0.60
  4. Removed
  5. 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."
  6. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive and open-world, so the safety profile is covered. The description adds real behavioral value beyond that: XSD validation runs before parsing, and schema/parse failures return an {"error": ...} payload instead of raising, which changes how an agent must handle the result. It does not discuss file-size limits, encoding, or multi-statement pagination behavior, so it stops short of full disclosure.

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?

Front-loaded with the one-line purpose, then usage routing, then behavior, then args/returns — a sensible ordering with no filler prose. It loses a point because the Args and Returns sections duplicate the input schema and the existing output schema almost verbatim.

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?

For a two-parameter read tool with full annotations and an output schema, the definition covers what matters: what it reads, what it returns at a high level, the error contract, and the sibling boundary. The remaining gaps (pagination/streaming for large statements, encoding assumptions) are minor given the output schema exists.

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 both parameter descriptions already state the local-path requirement and that xsd_file_path triggers pre-parse validation. The description largely restates those same facts ('Reads xml_file_path from the local filesystem', 'the document is first validated against that XSD'), adding little new meaning, so the baseline 3 applies.

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 ('Parse a camt.053 bank-statement XML file on disk into structured data') and immediately distinguishes the output shape (header + entry list). It also names the sibling it is not ('parse_pain002') so an agent can route without opening either schema.

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?

Explicit when-to-use ('read a bank's account statement ... the reply that confirms settlement'), explicit alternative for the adjacent case (parse_pain002 for payment-status replies), and an explicit exclusion ('to validate a camt.053 string you already hold, this is not it — this tool needs a file path'). The file-path precondition is stated as a selection criterion, not just a parameter fact.

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