Skip to main content
Glama

Reconcile many-to-many

reconcile_many_to_many
Read-onlyIdempotent

Match statement deposits to disjoint subsets of invoices via subset-sum ILP, resolving consolidated or split remittances that one-to-one or one-to-many heuristics miss.

Instructions

Match statement deposits to disjoint subsets of invoices via subset-sum ILP.

Purpose: Solves bounded subset-sum as an integer linear program (ILP) to pair statement deposits against matching combinations of outstanding invoice records.

When to use:

  • When customer deposits consolidate multiple invoices or split remittances.

  • When one-to-one or one-to-many heuristics leave unmatched aggregates.

When NOT to use:

  • Do NOT use for straightforward 1:1 or 1:N reconciliation where reconcile is sufficient and faster.

  • Do NOT use without the optional ilp extra installed (pip install reconcile-mcp[ilp]).

Behavioral transparency: Deterministic ILP optimization; read-only and idempotent.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
invoicesYesList 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).
statementsYesList 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

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.0.5

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already cover readOnly/idempotent/non-destructive, but the description adds genuine context beyond them: deterministic ILP optimization, bounded subset-sum formulation, and the hard dependency on the optional 'ilp' extra (pip install reconcile-mcp[ilp]). It does not discuss runtime cost or result ambiguity, but the dependency disclosure is valuable.

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 the core action, then cleanly sectioned into Purpose / When to use / When NOT to use / Behavioral transparency. Every line carries information, though the labeled headings are slightly more verbose than an inline two-sentence form would be.

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 so return values need not be explained. With usage conditions, exclusions, dependency requirement, and behavioral profile all covered for a 2-param tool, nothing an agent needs to invoke it correctly is missing.

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% and both parameters are richly documented in the schema itself (id, amount, currency, date, counterparty, reference). The description adds no syntax or format detail beyond what the schema already supplies, so baseline 3 applies.

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+resource (match statement deposits to disjoint subsets of invoices) plus the mechanism (subset-sum ILP). It explicitly contrasts with the sibling 'reconcile', so an agent can distinguish the two without reading 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?

Provides explicit 'when to use' cases (consolidated deposits, split remittances, unmatched aggregates) and explicit 'when NOT to use' cases naming the alternative tool 'reconcile' and the missing-extra prerequisite. Routing is unambiguous.

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