Skip to main content
Glama

Work out who owes whom in the fewest payments

halves_settle_up
Read-onlyIdempotent

Use when the user shares a trip, dinner, household or group expense list and asks who owes whom, how to split costs, or how to settle up. Returns each person's paid, share and net balance, and the smallest set of payments that squares everyone up. Handles equal splits, splits among a subset, exact amounts and payments already made, with correct rounding. Nothing is saved. Example: {"people": ["Ana", "Ben", "Cy"], "expenses": [{"what": "Dinner", "amount": 90, "paid_by": "Ana"}, {"what": "Taxi", "amount": 24, "paid_by": "Ben", "split_between": ["Ben", "Cy"]}]}. Amounts are exact to the cent.

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": {
      "people": "<people>",
      "expenses": "<expenses>"
    },
    "name": "halves_settle_up"
  }
}

Input Schema

NameRequiredDescriptionDefault
peopleYesNames of everyone in the group (2 to 40, unique).
currencyNoISO currency code, default USD.
expensesYesWhat was paid.
paymentsNoPayments already made between people to settle up.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already cover readOnly, idempotent, closed-world and non-destructive, so the description's job is to add what they can't: it discloses the return contents (paid, share, net balance, minimal payment set), the split modes supported, rounding correctness, and that nothing is persisted. It does not describe error behavior for unknown names or mismatched exact amounts, leaving a small gap.

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 usage trigger, followed by return contents, capability list, persistence note, and a compact example that earns its space by demonstrating nested structure. The capability sentence is dense but each clause maps to a distinct schema feature, so little is wasted.

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 no output schema, the description carries the return-value burden and does so explicitly (balances plus minimal settlement payments). It is nearly complete for a pure-computation tool; only error/validation behavior and the currency parameter go unmentioned.

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%, so the baseline is 3; the description earns above that by mapping its feature list onto the schema fields (equal splits to split_between, subset splits, exact amounts to the 'exact' map, already-made payments to the payments array) and by giving a worked example showing the expected shape. Currency and the 2–40 person limit are left to the schema.

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 verb-and-resource pair ('work out who owes whom', 'smallest set of payments') and states what the tool computes rather than merely restating the name. It also implicitly separates itself from the sibling link-creation tool by declaring 'Nothing is saved.'

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 opening sentence gives concrete trigger conditions (trip, dinner, household or group expense lists; questions about who owes whom, splitting, or settling up). It does not name an explicit alternative or a when-not case, which is the only thing separating it from a 5.

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