Skip to main content
Glama

Validate against scheme rulebook

validate_payment_scheme
Read-onlyIdempotent

Validate payment records against a payment-scheme rulebook such as SEPA to enforce field lengths, allowed characters, and currency/BIC constraints after structural JSON-Schema checks.

Instructions

Validate records against a payment-scheme rulebook (e.g. SEPA).

Use this after ``validate_records`` to enforce scheme-specific business
rules (SEPA field lengths, allowed characters, currency/BIC constraints)
that JSON-Schema validation alone does not cover. ``validate_records``
checks structural shape; this checks rulebook compliance for one profile.

Delegates to :func:`pain001.validate_scheme`. The ``profile``
parameter lists every profile the installed pain001 ships.

Args:
    records: Payment records as a list of flat dicts.
    profile: The scheme profile name.

Returns:
    ``{"profile", "is_valid", "violations": [...]}`` with structured
    ``violations`` (each with ``rule``, ``severity``, ``field``,
    ``message``, ``remediation`` keys), or ``{"error": ...}`` for an
    unknown profile.

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": {
      "records": "<records>"
    },
    "name": "validate_payment_scheme"
  }
}

Input Schema

NameRequiredDescriptionDefault
profileNoThe payment-scheme rulebook profile to enforce, or several joined by commas (e.g. 'sepa-sct,anti-duplicate'). One of 'ae-uaefts', 'anti-duplicate', 'cbpr-cross-border', 'ch-domestic', 'ch-sepa', 'de-axz', 'de-ccu', 'hk-fps', 'my-duitnow', 'purpose-mandate-ae', 'purpose-mandate-gb', 'purpose-mandate-hk', 'purpose-mandate-my', 'purpose-mandate-qa', 'qa-qatch', 'se-bankgiro', 'sepa-b2b', 'sepa-inst', 'sepa-sct', 'sepa-sdd', 'sg-fast', 'uk-bacs', 'uk-bacs-dd', 'uk-chaps', 'uk-fps', 'us-ach', 'us-rtp', 'us-wire', 'xborder-ct'. Defaults to 'sepa-sct'.sepa-sct
recordsYesPayment records as a list of flat dicts (field name → value) to check against the scheme rulebook.

Output Schema

NameRequiredDescriptionDefault
errorNo
profileNo
is_validNo
violationsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.0.84
    • addedInput schema / properties / profile / anyOf
      Added value: +[
      +  {
      +    "enum": [
      +      "ae-uaefts",
      +      "anti-duplicate",
      +      "cbpr-cross-border",
      +      "ch-domestic",
      +      "ch-sepa",
      +      "de-axz",
      +      "de-ccu",
      +      "hk-fps",
      +      "my-duitnow",
      +      "purpose-mandate-ae",
      +      "purpose-mandate-gb",
      +      "purpose-mandate-hk",
      +      "purpose-mandate-my",
      +      "purpose-mandate-qa",
      +      "qa-qatch",
      +      "se-bankgiro",
      +      "sepa-b2b",
      +      "sepa-inst",
      +      "sepa-sct",
      +      "sepa-sdd",
      +      "sg-fast",
      +      "uk-bacs",
      +      "uk-bacs-dd",
      +      "uk-chaps",
      +      "uk-fps",
      +      "us-ach",
      +      "us-rtp",
      +      "us-wire",
      +      "xborder-ct"
      +    ],
      +    "type": "string"
      +  },
      +  {
      +    "pattern": "^(?:\\s*,)*\\s*(?:ae-uaefts|anti-duplicate|cbpr-cross-border|ch-domestic|ch-sepa|de-axz|de-ccu|hk-fps|my-duitnow|purpose-mandate-ae|purpose-mandate-gb|purpose-mandate-hk|purpose-mandate-my|purpose-mandate-qa|qa-qatch|se-bankgiro|sepa-b2b|sepa-inst|sepa-sct|sepa-sdd|sg-fast|uk-bacs|uk-bacs-dd|uk-chaps|uk-fps|us-ach|us-rtp|us-wire|xborder-ct)\\s*(?:,\\s*(?:(?:ae-uaefts|anti-duplicate|cbpr-cross-border|ch-domestic|ch-sepa|de-axz|de-ccu|hk-fps|my-duitnow|purpose-mandate-ae|purpose-mandate-gb|purpose-mandate-hk|purpose-mandate-my|purpose-mandate-qa|qa-qatch|se-bankgiro|sepa-b2b|sepa-inst|sepa-sct|sepa-sdd|sg-fast|uk-bacs|uk-bacs-dd|uk-chaps|uk-fps|us-ach|us-rtp|us-wire|xborder-ct)\\s*)?)*$",
      +    "type": "string"
      +  }
      +]
    • changedInput schema / properties / profile / description
      Previous value: -"The payment-scheme rulebook profile to enforce. One of 'sepa-sct', 'sepa-sdd', 'sepa-inst', or 'xborder-ct'. Defaults to 'sepa-sct'."New value: +"The payment-scheme rulebook profile to enforce, or several joined by commas (e.g. 'sepa-sct,anti-duplicate'). One of 'ae-uaefts', 'anti-duplicate', 'cbpr-cross-border', 'ch-domestic', 'ch-sepa', 'de-axz', 'de-ccu', 'hk-fps', 'my-duitnow', 'purpose-mandate-ae', 'purpose-mandate-gb', 'purpose-mandate-hk', 'purpose-mandate-my', 'purpose-mandate-qa', 'qa-qatch', 'se-bankgiro', 'sepa-b2b', 'sepa-inst', 'sepa-sct', 'sepa-sdd', 'sg-fast', 'uk-bacs', 'uk-bacs-dd', 'uk-chaps', 'uk-fps', 'us-ach', 'us-rtp', 'us-wire', 'xborder-ct'. Defaults to 'sepa-sct'."
    • removedInput schema / properties / profile / type
      Removed value: -"string"
  2. Changed1 schema field changedv0.0.71
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$defs": {
      +    "SchemeViolation": {
      +      "description": "One rulebook violation, with the remediation the library suggests.",
      +      "properties": {
      +        "field": {
      +          "title": "Field",
      +          "type": "string"
      +        },
      +        "index": {
      +          "title": "Index",
      +          "type": "integer"
      +        },
      +        "message": {
      +          "title": "Message",
      +          "type": "string"
      +        },
      +        "remediation": {
      +          "title": "Remediation",
      +          "type": "string"
      +        },
      +        "rule": {
      +          "title": "Rule",
      +          "type": "string"
      +        },
      +        "severity": {
      +          "title": "Severity",
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "rule",
      +        "field",
      +        "index",
      +        "message",
      +        "remediation",
      +        "severity"
      +      ],
      +      "title": "SchemeViolation",
      +      "type": "object"
      +    }
      +  },
      +  "description": "Verdict against a scheme rulebook profile.",
      +  "properties": {
      +    "error": {
      +      "title": "Error",
      +      "type": "string"
      +    },
      +    "is_valid": {
      +      "title": "Is Valid",
      +      "type": "boolean"
      +    },
      +    "profile": {
      +      "title": "Profile",
      +      "type": "string"
      +    },
      +    "violations": {
      +      "items": {
      +        "$ref": "#/$defs/SchemeViolation"
      +      },
      +      "title": "Violations",
      +      "type": "array"
      +    }
      +  },
      +  "title": "SchemeResult",
      +  "type": "object"
      +}
  3. Addedv0.0.60
  4. Removed
  5. Changed2 schema fields changedv0.0.56
    • addedInput schema / properties / profile / description
      Added value: +"The payment-scheme rulebook profile to enforce. One of 'sepa-sct', 'sepa-sdd', 'sepa-inst', or 'xborder-ct'. Defaults to 'sepa-sct'."
    • addedInput schema / properties / records / description
      Added value: +"Payment records as a list of flat dicts (field name → value) to check against the scheme rulebook."
  6. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent and non-destructive, so the safety profile is covered. The description adds real value on top: it names the underlying delegate (pain001.validate_scheme), states that the profile parameter enumerates every profile the installed package ships, and describes the failure behavior for an unknown profile returning an error object. It stops short of describing cost/performance or whether validation is pure, but the disclosed behavior is substantial.

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?

Front-loaded with purpose and the sibling distinction, then organized into Args/Returns. The docstring scaffolding is conventional and readable, though the Returns block is somewhat redundant given an output schema exists and the prose runs longer than strictly necessary.

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

Completeness4/5

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

For a two-parameter read-only validator with an output schema present, the description covers purpose, prerequisites, delegation, and error cases. The only real omission is how multiple comma-joined profiles behave (aggregate violations? evaluated independently?), plus redundancy in the Returns block.

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

Parameters3/5

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

Schema coverage is 100%, so the schema already documents both parameters, including the full enum and the default. The description mostly restates the args and adds a helpful note that the profile list reflects the installed pain001 version, but it describes the tool as checking 'one profile' while the schema permits several comma-joined profiles, which is a mild inconsistency that could mislead on multi-profile use.

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?

States a specific verb and resource ('Validate records against a payment-scheme rulebook'), gives a concrete example (SEPA), and explicitly separates itself from the sibling validate_records as rulebook compliance vs. structural shape. An agent can pick between the two without opening either schema.

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?

Gives explicit sequencing ('Use this after validate_records'), names the alternative and the precise condition that distinguishes it ('validate_records checks structural shape; this checks rulebook compliance'), and illustrates the rule classes covered (field lengths, allowed characters, currency/BIC constraints). Nothing about when to call this is left to inference.

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