Skip to main content
Glama

Commit staged payment batch

commit_payment_batch

Finalizes a staged payment batch with its stage ID and confirmation token, transitioning the order to committed and optionally writing the ISO 20022 XML output.

Instructions

Commit a staged payment batch with its confirmation token.

Verifies the stage ID and validates the secondary confirmation token
using constant-time cryptographic comparison (preventing timing attacks).
Transitions the order status from 'staged' to 'committed'. Optionally
writes a new ``.xml`` file inside the output directory (see
``_output.py``). The token guards against an accidental commit only.

Args:
    stage_id: Staging identifier from stage_payment_batch.
    confirmation_token: Secondary secret confirmation token.
    output_file_path: Optional new XML file in the output directory.

Returns:
    CommitPaymentBatchResult with commit timestamp and fingerprint,
    or {"error": ...}.

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": {
      "stage_id": "<stage_id>",
      "confirmation_token": "<confirmation_token>"
    },
    "name": "commit_payment_batch"
  }
}

Input Schema

NameRequiredDescriptionDefault
stage_idYesThe staging identifier returned by stage_payment_batch.
output_file_pathNoOptional new .xml file inside the output directory (PAIN001_MCP_OUTPUT_DIR, else the working directory).
confirmation_tokenYesThe confirmation token stage_payment_batch returned for this batch.

Output Schema

NameRequiredDescriptionDefault
errorNo
statusNo
stage_idNo
committed_atNo
output_file_pathNo
sha256_fingerprintNo
total_transactionsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.0.84
    • changedInput schema / properties / confirmation_token / description
      Previous value: -"Secondary authorization token required to execute the dual-control commit."New value: +"The confirmation token stage_payment_batch returned for this batch."
    • changedInput schema / properties / output_file_path / description
      Previous value: -"Optional local filesystem destination path to write the committed XML document."New value: +"Optional new .xml file inside the output directory (PAIN001_MCP_OUTPUT_DIR, else the working directory)."
  2. Addedv0.0.72

TDQS

A3.8/5.0
Behavior4/5

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

Goes well beyond the annotations by disclosing the state transition ('staged' to 'committed'), the optional side effect of writing a new .xml file into the output directory, and the important caveat that the token guards only against accidental commits rather than acting as a security control. It does not say what happens on a failed verification or whether a second commit attempt on the same stage errors, which is the remaining gap for a non-idempotent mutation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose is front-loaded in the first line, but the Args block duplicates a fully documented schema and the Returns block restates what the output schema already provides, plus an internal code reference ('see _output.py') that is noise to an agent. Trimmed of those, the substantive content would be two or three sentences.

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 non-idempotent, open-world mutation the description covers the key facts an agent needs: required inputs, the state transition, the file-write side effect, the error return shape, and the limited scope of the token. Failure semantics for an invalid stage or reused token are the only notable omission.

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 description coverage is 100%, so all three parameters are already documented, and the description largely repeats them (stage_id origin, token, optional XML path). The only marginal addition is describing the token as a 'secondary secret' and clarifying the constant-time verification, not new syntax or constraints for the parameters.

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 ('Commit a staged payment batch') plus the required credential, which makes clear this is the terminal step after staging rather than a simulate or validate operation. The named argument 'stage_id: Staging identifier from stage_payment_batch' reinforces which sibling precedes it.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied by 'staged' and by the reference to stage_payment_batch, so an agent can infer this runs after staging. However, there is no explicit statement that staging (and possibly simulate_payment_batch) must precede it, no guidance on when to prefer a dry run, and no exclusions.

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