Summarize statement balances
summarize_statementExtract opening and closing balances, currency, and summary fields from bank statements in CAMT, MT940, CSV, OFX, or QFX format. Omits per-transaction rows.
Instructions
Summarize an inline statement's balances and totals only.
Use this when you need just the opening/closing balances, currency, and
other summary fields without the per-transaction rows. For the full
transaction detail alongside the summary, use ``parse_statement``
instead.
Args:
content: The raw statement text.
filename: Original filename; its extension selects the format.
format: Explicit format override.
Returns:
The summary record with Decimal values stringified.
Raises:
ValueError: If the format is unsupported or cannot be detected.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | Explicit format identifier that overrides detection from the filename. Must be exactly one of: 'camt', 'csv', 'mt940', 'ofx', 'pain001', 'qfx' (see list_supported_formats). When omitted, the format is inferred from the filename extension. | |
| content | Yes | The raw statement text to summarize, inline (not a file path). Accepts ISO 20022 CAMT.053 and pain.001 XML, SWIFT MT940, CSV exports, and OFX/QFX payloads. | |
| filename | No | Original filename of the payload; its extension (.xml, .csv, .ofx, .qfx, .mt940, .sta) selects the format when 'format' is omitted. Defaults to 'statement.xml'. | statement.xml |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||