Parse camt.053 statement file
parse_camt053Parses 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
| Name | Required | Description | Default |
|---|---|---|---|
| xml_file_path | Yes | Local filesystem path to the camt.053 bank-statement XML file to parse. | |
| xsd_file_path | No | Optional local path to a camt.053 XSD; when given, the document is validated against it before parsing. Omit to skip schema validation. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| iban | No | ||
| error | No | ||
| entries | No | ||
| currency | No | ||
| statements | No | ||
| statement_id | No | ||
| electronic_sequence_number | No |