Skip to main content
Glama

Validate records against schema

validate_records
Read-onlyIdempotent

Validate 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

NameRequiredDescriptionDefault
recordsYesOne 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_typeYesA 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_checksNoCheck 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

NameRequiredDescriptionDefault
errorNo
totalNo
validNo
errorsNo
valid_countNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.0.87
    • changedOutput schema / $defs / RecordError / description
      Previous value: -"One schema violation: the record's row, the field path, the message."New value: +"One finding: the record's row and line, the field, the code, why.\n\n``row`` counts records from 0 and ``line`` from 1, as the core's\nissues do; ``code`` is the core's stable ``P001-E...`` issue code."
    • addedOutput schema / $defs / RecordError / properties / code
      Added value: +{
      +  "title": "Code",
      +  "type": "string"
      +}
    • addedOutput schema / $defs / RecordError / properties / line
      Added value: +{
      +  "title": "Line",
      +  "type": "integer"
      +}
    • changedOutput schema / $defs / RecordError / required
      Previous value: -[
      -  "row",
      -  "path",
      -  "message"
      -]New value: +[
      +  "row",
      +  "line",
      +  "path",
      +  "code",
      +  "message"
      +]
  2. Changed1 schema field changedv0.0.84
    • addedInput schema / properties / identifier_checks
      Added value: +{
      +  "default": true,
      +  "description": "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.",
      +  "title": "Identifier Checks",
      +  "type": "boolean"
      +}
  3. Changed1 schema field changedv0.0.71
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$defs": {
      +    "RecordError": {
      +      "description": "One schema violation: the record's row, the field path, the message.",
      +      "properties": {
      +        "message": {
      +          "title": "Message",
      +          "type": "string"
      +        },
      +        "path": {
      +          "title": "Path",
      +          "type": "string"
      +        },
      +        "row": {
      +          "title": "Row",
      +          "type": "integer"
      +        }
      +      },
      +      "required": [
      +        "row",
      +        "path",
      +        "message"
      +      ],
      +      "title": "RecordError",
      +      "type": "object"
      +    }
      +  },
      +  "description": "Verdict over a batch: one entry per violation, plus the counts.",
      +  "properties": {
      +    "error": {
      +      "title": "Error",
      +      "type": "string"
      +    },
      +    "errors": {
      +      "items": {
      +        "$ref": "#/$defs/RecordError"
      +      },
      +      "title": "Errors",
      +      "type": "array"
      +    },
      +    "total": {
      +      "title": "Total",
      +      "type": "integer"
      +    },
      +    "valid": {
      +      "title": "Valid",
      +      "type": "boolean"
      +    },
      +    "valid_count": {
      +      "title": "Valid Count",
      +      "type": "integer"
      +    }
      +  },
      +  "title": "ValidateRecordsResult",
      +  "type": "object"
      +}
  4. Changed2 schema fields changedv0.0.67
    • changedInput schema / properties / message_type / description
      Previous value: -"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.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'."New value: +"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'."
    • changedInput schema / properties / message_type / enum
      Previous value: -[
      -  "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.001",
      -  "pain.008"
      -]New value: +[
      +  "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"
      +]
  5. Changed2 schema fields changed
    • changedInput schema / properties / message_type / description
      Previous value: -"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.008.001.02', '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'."New value: +"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.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'."
    • changedInput schema / properties / message_type / enum
      Previous value: -[
      -  "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.008.001.02",
      -  "pain.001",
      -  "pain.008"
      -]New value: +[
      +  "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.001",
      +  "pain.008"
      +]
  6. Addedv0.0.60
  7. Removed
  8. Changed2 schema fields changed
    • changedInput schema / properties / message_type / description
      Previous value: -"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.008.001.02' (see list_message_types)."New value: +"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.008.001.02', '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'."
    • changedInput schema / properties / message_type / enum
      Previous value: -[
      -  "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.008.001.02"
      -]New value: +[
      +  "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.008.001.02",
      +  "pain.001",
      +  "pain.008"
      +]
  9. Changed2 schema fields changedv0.0.57
    • changedInput schema / properties / message_type / description
      Previous value: -"A supported ISO 20022 pain message type whose input JSON Schema the records are checked against, e.g. 'pain.001.001.09' — see list_message_types."New value: +"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.008.001.02' (see list_message_types)."
    • addedInput schema / properties / message_type / enum
      Added value: +[
      +  "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.008.001.02"
      +]
  10. Changed2 schema fields changedv0.0.56
    • addedInput schema / properties / message_type / description
      Added value: +"A supported ISO 20022 pain message type whose input JSON Schema the records are checked against, e.g. 'pain.001.001.09' — see list_message_types."
    • addedInput schema / properties / records / description
      Added value: +"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)."
  11. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already establish a safe, idempotent read, but the description adds substantial behavioral detail beyond them: the validation ladder order, batch-level refusal versus per-row schema reporting, the exact error fields, the return report shape, and error cases for non-batch rows, empty lists and unknown message types. Nothing contradicts the annotations.

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?

The description is front-loaded with purpose and the key generate_message relationship before moving into validation ladder details, error structure and return shape. It is dense but largely earned; a few implementation-level details could be trimmed, but none are materially distracting.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a validator with three parameters, an output schema and annotations, the description covers the essential calling context: what is checked, order of checks, how failures are reported, and the return/error shapes. An agent has enough information to call and interpret it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so parameter descriptions already carry most semantics. The prose reinforces identifier_checks as an IBAN/BIC skip switch and describes records as flat payment rows, but adds little beyond the schema's own explanatory text, so it sits just above the baseline rather than fully supplementing it.

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?

The description states a specific verb and resource — validating flat payment records — and ties it to the pain001 CLI, REST API and generate_message behavior. It clearly distinguishes itself from validate_payment_scheme, which covers rulebook checks, so an agent can tell which validation layer to use.

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?

It explicitly says to use this before generate_message, explains why the result is accepted by the CLI/REST API/generate_message, and directs agents to validate_payment_scheme for SEPA rulebook checks. That gives both when-to-use and a concrete alternative.

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