Skip to main content
Glama

WritersLogic verifiable AI agents

reconcile-ledger

Exact Ledger Reconciler — Explains which charges, refunds and fees make up a Stripe, PayPal or bank payout, with an exact solver instead of a model: subset-sum over integer minor units (meet-in-the-middle, DP, branch-and-bound) across candidate fee schedules (percentage + fixed, tiers, caps), withholding, FX rates and rounding conventions (half-up, half-even, truncate; per line or on the total). Paste a Stripe balance or p

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "reconcile-ledger"
  }
}

Input Schema

NameRequiredDescriptionDefault
textNoMessy source text for collections not given structurally. A CSV with a header (Stripe balance or payout-reconciliation export, PayPal activity export, bank statement) is parsed by code with no model, and so are headerless lines with one amount each (date, id, amount, currency, and wording that names one kind, such as Payment or Refund); anything else goes to a fast-tier LLM that must quote every row verbatim.
itemsNoLedger lines. Amounts are signed (refunds and disputes negative) strings in major units, e.g. "1234.56".
limitsNo
fxRatesNoDirect rates only (1 from = rate to). The latest rate dated on or before the reference date applies; an undated rate is the fallback.
crossCheckNoRun two independent LLM translations and keep only rows both produced (default true).
maxLagDaysNoAn item may settle at most this many days after its date.
conventionsNoRestrict the conventions searched (default: all rounding modes x both scopes x both FX date policies).
settlementsNoPayouts or bank settlement totals to explain.
feeSchedulesNoCandidate fee schedules; the solver reports which one reconciles each settlement. Omit for no fees.
withholdingsNo
toleranceMinorNoAccepted |residual| per settlement in minor units (default 0 = exact).
defaultCurrencyNoCurrency for text rows that state none.
nearMissToleranceMinorNoLargest residual searched when reporting the closest near-miss for an unmatched settlement.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.1/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full disclosure burden. It does convey genuinely useful behavior — exact integer-minor-unit solving via meet-in-the-middle/DP/branch-and-bound, fee schedules, withholding, FX and rounding conventions — but it never states what the tool returns, how unmatched or ambiguous settlements are reported, or the cost/limit implications of the combinatorial search.

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 core definition is front-loaded in the opening clause, and the technical detail is dense but purposeful. The final sentence is cut off mid-word ('Paste a Stripe balance or p'), which costs clarity and leaves an unresolved instruction.

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

Completeness2/5

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

This is a 13-parameter tool with nested objects, no annotations and no output schema, so the description should explain the result shape and how reconciliations, near-misses and unsolved settlements come back. It explains the computational model but says nothing about return values, and the truncation leaves the primary input instruction incomplete.

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 85%, so the schema already explains most parameters (rounding scopes, FX policy, limits, tolerance). The description only broadly gestures at the same concepts ('across candidate fee schedules (percentage + fixed, tiers, caps), withholding, FX rates and rounding conventions') without adding format or precedence detail beyond the structured fields. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb and resource — 'Explains which charges, refunds and fees make up a Stripe, PayPal or bank payout' — plus the mechanism (an exact subset-sum solver rather than an LLM). That is far more specific than a restated name, though it never positions itself against the listed siblings such as spend-ledger or chargeback-fighter.

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 the framing (paste a Stripe balance/payout export when you need a payout explained), and the solver's determinism hints at when to prefer it over a model-based approach. However, there is no explicit when-to-use/when-not statement and no named alternative, so the agent must infer the routing decision.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources