Skip to main content
Glama

reconcile

Read-onlyIdempotent

Match expected payments to observed bank-statement entries, then produce an explainable report with confidence scores for exact matches, adjustments, split settlements, batch credits, and unmatched residuals.

Instructions

Reconcile expected payments against observed bank-statement entries.

Purpose: Matches expected payment instructions (e.g. from pain.001) against observed bank transactions (e.g. from camt.053) and produces an explainable reconciliation report covering exact matches, short/over adjustments, split settlements (one-to-many), batch credits (many-to-one), and unmatched residuals.

When to use:

  • When performing multi-transaction cash reconciliation between ledgers and statements.

  • When transparent per-match confidence scores and reason breakdowns are required for audit.

When NOT to use:

  • Expects canonical record dicts rather than raw XML; normalize parsed inputs first with normalize_pain001 or normalize_camt053.

  • Evaluates full batches rather than single-pair tuning analysis; use explain_match to inspect one pair.

  • Runs greedy and bounded matching rather than unconstrained combinatorial invoice subsets; use reconcile_many_to_many for subset-sum ILP.

Behavioral transparency: Pure, deterministic, side-effect-free, read-only calculation without network or disk access.

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": {
      "expected": "<expected>",
      "observed": "<observed>"
    },
    "name": "reconcile"
  }
}

Input Schema

NameRequiredDescriptionDefault
optionsNoOptional tuning object: 'abs_tol'/'rel_tol' (amount tolerance), 'date_window_days', 'high_threshold', 'review_threshold', 'currency_strict', 'enable_one_to_many', 'max_combination'.
expectedYesList of canonical records. Each is an object with 'id' (string) and 'amount' (number) required, plus optional 'currency' (ISO 4217), 'date' (ISO-8601), 'counterparty' (name), 'reference' (remittance/end-to-end id).
observedYesList of canonical records. Each is an object with 'id' (string) and 'amount' (number) required, plus optional 'currency' (ISO 4217), 'date' (ISO-8601), 'counterparty' (name), 'reference' (remittance/end-to-end id).

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.2

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, closed-world, so 'pure, deterministic, side-effect-free, read-only calculation without network or disk access' largely restates structured data. It does add value by disclosing the algorithm class ('greedy and bounded matching') and that per-match confidence scores and reason breakdowns are produced, which annotations cannot convey. No contradiction with 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?

Front-loaded one-line summary followed by clearly labeled Purpose / When to use / When NOT to use / Behavioral transparency blocks, so an agent can scan quickly. Slightly verbose: the behavioral line repeats annotation-derived facts (read-only, no network) that the agent already has.

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 deterministic two-array matching engine with an output schema, everything an agent needs is present: required inputs and their canonical shape, tuning options, alternative tools, and the character of the result. Return values are covered by the output schema, so their absence from the description is not a gap.

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% and the options keys are already enumerated in the schema, so the description does not need to re-document them. What it does add beyond schema is the input-shape contract ('expects canonical record dicts rather than raw XML; normalize parsed inputs first'), which materially affects how the caller must prepare expected/observed arrays.

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 ('Reconcile expected payments against observed bank-statement entries') and the Purpose block names the concrete input formats (pain.001 / camt.053) and output artifact (explainable reconciliation report covering exact matches, adjustments, splits, batch credits, residuals). This is detailed enough that an agent can distinguish it from reconcile_many_to_many and explain_match without opening schemas.

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?

Explicit 'When to use' and 'When NOT to use' sections, and the exclusions name concrete alternatives with the condition that selects them: normalize_pain001/normalize_camt053 for raw XML, explain_match for single-pair analysis, reconcile_many_to_many for subset-sum ILP. Nothing 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.