Validate records against schema
validate_recordsValidate flat payment records against the same checks used by the pain001 CLI and REST API before generating a message. It verifies row fields, IBANs, BICs, batch consistency, and message-type schema.
Instructions
Validate flat records the way the pain001 CLI and REST API do.
Use this before ``generate_message``: it runs the core's validation
ladder (pain001.validate), so a batch it accepts is one the CLI,
the REST API and ``generate_message`` accept, and a batch it
refuses is refused there too. The ladder checks the row contract
(required fields, amounts, booleans, dates), every IBAN and BIC
(unless ``identifier_checks`` is false), that the rows form one
payment information block, then the message type's JSON Schema
(for example an ISO 4217 currency). For payment-scheme rulebook
checks (SEPA field lengths, charset, etc.) also run
``validate_payment_scheme``.
The row contract and identifier checks refuse the batch as a whole
(``valid_count`` 0) and name the first problems; the schema check
then reports every row. Each error carries ``row`` (from 0),
``line`` (from 1), ``path`` (the field), ``code`` (the core's
stable ``P001-E...`` issue code) and ``message``, which never
repeats the value.
Returns a report ``{"valid": bool, "total": int, "valid_count": int,
"errors": [...]}``, or ``{"error": ...}`` for rows that do not form
one batch, an empty list or an unknown message type.
Args:
message_type: A supported ISO 20022 pain message type.
records: One or more flat payment records to validate.
identifier_checks: If false, skip the IBAN and BIC checks.
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": {
"message_type": "<message_type>",
"records": "<records>"
},
"name": "validate_records"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| records | Yes | One or more flat payment records to validate, each a dict of field name → value (see get_input_schema for the fields and get_required_fields for the mandatory ones). | |
| message_type | Yes | A supported ISO 20022 pain message type. Must be exactly one of: 'pain.001.001.03', 'pain.001.001.04', 'pain.001.001.05', 'pain.001.001.06', 'pain.001.001.07', 'pain.001.001.08', 'pain.001.001.09', 'pain.001.001.10', 'pain.001.001.11', 'pain.001.001.12', 'pain.001.001.13', 'pain.008.001.02', 'pain.008.001.08', 'pain.001', 'pain.008' (see list_message_types). The bare family names 'pain.001' and 'pain.008' are accepted as aliases for 'pain.001.001.09' and 'pain.008.001.02'. | |
| identifier_checks | No | Check every IBAN (mod-97) and BIC (ISO 9362) column, as the pain001 CLI and file loaders do (default true). Set false only for identifiers you have verified another way, the CLI's --no-identifier-checks. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | ||
| total | No | ||
| valid | No | ||
| errors | No | ||
| valid_count | No |