Convert legacy MT940 to camt.053
convert_mt940_to_camt053Convert raw SWIFT MT940 statement text into a JSON-serialisable camt.053 structure, enabling downstream analysis for ISO 20022 migration.
Instructions
Convert a legacy SWIFT MT940 statement into a camt.053 structure.
Use this as the Phase-1 migration wedge: SWIFT MT940 customer statements
retire in **November 2028**, so this tool bridges the gap by turning raw
MT940 text into the same JSON-serialisable camt.053 document shape that
``parse_statement`` returns (group header plus statements, each with its
account, balances, and entries). Downstream tools (``list_entries``,
``filter_entries``, ``classify_entry``, ``export_journal``) then work on the
result unchanged.
Wraps the ``camt053-loader-mt940`` library's ``parse_mt940``; the MT parsing
itself is delegated (no MT grammar is reimplemented here). The resulting
``ParsedDocument`` is serialised with the same ``to_dict()`` the server's
other parse tools use, so agents get a consistent structure. Nothing is read
from or written to disk.
Returns the converted document as a JSON-serialisable dict, or an
``{"error": ...}`` payload if the MT940 text cannot be parsed (e.g. a
missing ``:20:`` reference or a malformed balance / statement line).
Args:
mt940_text: The raw MT940 statement text as a string.
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": {
"mt940_text": "<mt940_text>"
},
"name": "convert_mt940_to_camt053"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mt940_text | Yes | The raw legacy SWIFT MT940 statement text as a string (``:20:`` / ``:25:`` / ``:28C:`` / ``:60F:`` / ``:61:`` / ``:86:`` / ``:62F:`` fields). Passed verbatim from the bank or ERP; no file path is accepted. |