Skip to main content
Glama

Reconcile many-to-many

reconcile_many_to_many
Read-onlyIdempotent

Match each statement or deposit to the subset of invoices whose amounts sum to it, returning matched groups and unmatched residuals on both sides.

Instructions

Match each statement/deposit to a disjoint subset of invoices whose amounts sum to it (bounded subset-sum solved as an integer program). Returns matched groups and the unmatched residuals on each side.

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.2/5.0
Behavior4/5

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

Annotations already mark it read-only and idempotent; the description adds meaningful behavioral details by stating it solves a bounded subset-sum as an integer program, enforces disjointness, and returns matched groups plus residuals on both sides. This goes beyond the structured annotations without contradicting them.

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

Conciseness5/5

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

Two sentences contain the core matching behavior and the return shape with no filler. The key constraint (disjoint subset-sum) is front-loaded, and every sentence contributes something.

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?

With a rich output schema, full parameter documentation, and annotations covering safety/idempotence, the description covers the essential behavioral contract. It could add more about currency/date handling or performance limits for large integer programs, but these are not critical given the structured fields.

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%, so the parameters are already fully documented with required fields and optional attributes. The description adds the matching semantics (invoice subsets summing to statement amounts), but it does not add syntax or format details beyond schema. Baseline 3 is appropriate.

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?

The description names a specific operation: matching each statement/deposit to a disjoint subset of invoices that sum to it, which clearly distinguishes it from a plain reconcile tool. The bounded subset-sum/integer program detail further specifies the method. This is more specific than the title and separates it from siblings like reconcile and explain_match.

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

Usage Guidelines4/5

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

The description makes the applicable scenario clear: many-to-many reconciliation where a statement amount is covered by several invoices and unmatched residuals should be reported. It does not explicitly name alternatives or when-not-to-use conditions, but the semantics are specific enough that an agent can infer when to invoke it.

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