Skip to main content
Glama
devops-gm88

mcp-validation-server

by devops-gm88

reconcile

Verify that opening balances plus movements equal closing balances, showing both sides and variance to catch arithmetic errors in financial reconciliations.

Instructions

Check that opening + movements = closing, and show both sides and the variance.

Use this whenever a period of numbers is supposed to add up: a bank reconciliation, a roll-forward, a statement extract, a ledger movement summary. It is the check that does not depend on how plausible any single figure looked. If the arithmetic does not close, the numbers are wrong even if every field looked fine on its own — that is the failure that survives field-level validation and reaches a report.

This tool is deterministic arithmetic. It has no opinion about whether the movements are the right movements; it only states whether the given opening, movements and closing are consistent with each other.

Args: opening_balance: The balance at the start of the period, as a number or a numeric string. Example: 1000.00. movements: The changes during the period, as an array. Each element is either a signed number (250.0 increases, -40.5 decreases) or an object {"amount": 250.0, "direction": "in", "label": "INV-1001", "date": "2026-04-03"}. Use "direction": "out" for a decrease, or pass the amount as a negative number — never both. Passing an outflow as a positive amount is the most common cause of a variance, so state the direction explicitly when you can. closing_balance: The balance at the end of the period, as a number or a numeric string. Example: 1210.00. tolerance: The largest variance to accept as closing, in the same units as the balances. Default 0.01, which suits two-decimal currency. Set it to 0 for an exact check.

Returns: An object with: ok (true only if the arithmetic closes), verdict ("clean" | "does_not_close" | "inputs_rejected"), opening_balance, movements_net, expected_closing_balance, reported_closing_balance, variance, absolute_variance, tolerance, closes (true/false, or null when the inputs were incomplete), arithmetic_is_reliable, movement_counts, movement_totals, movements (each parsed movement with its signed amount), findings, and guidance.

`findings` always shows both sides of the equation in words, so the
variance can be read without recomputing it. When the variance exactly
equals the size of one movement, an extra finding says so — that is
arithmetic, not a guess, and it is usually the answer.

Raises: Nothing for bad data. A movement that cannot be read is reported in findings and excluded, and closes becomes null with arithmetic_is_reliable: false, because a total over an incomplete set of movements must never be reported as a pass. Genuinely malformed arguments (movements that are not an array at all, or a non-numeric opening or closing balance) return the same envelope with verdict set to "inputs_rejected".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
movementsYes
toleranceNo
closing_balanceYes
opening_balanceYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so: deterministic arithmetic with no side effects, unreadable movements are excluded and reported in findings, closes becomes null with arithmetic_is_reliable false, and malformed arguments yield verdict 'inputs_rejected'. Unusually thorough error-behavior disclosure.

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 equation is front-loaded and the Args/Returns/Raises structure is scannable, but several sentences are motivational rhetoric ('the failure that survives field-level validation and reaches a report') that an agent does not strictly need. Long yet mostly earning its space.

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?

Output schema exists, yet the description still usefully flags the notable return fields and the findings behavior, including the special case where variance equals one movement. Edge cases and failure modes are covered, so nothing needed to call it correctly is missing.

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

Parameters5/5

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

Schema coverage is 0%, so the description must compensate and it does — opening/closing accept numbers or numeric strings, movements accept signed numbers or objects with amount/direction/label/date, the never-both direction rule is stated, and tolerance is explained with its default and 'set 0 for exact' semantics.

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 precise verb and resource — verify opening + movements = closing — and immediately frames the scope ('a period of numbers'). It also carves out its distinction from sibling validate_rows by contrasting field-level validation with whole-period arithmetic.

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 triggering conditions ('whenever a period of numbers is supposed to add up') with concrete examples (bank reconciliation, roll-forward, statement extract, ledger movement summary), and states the exclusion plainly: it has no opinion on whether the movements are the right ones.

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