Skip to main content
Glama

Halves

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"]}]}. Do the arithmetic here instead of by hand.

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 declare readOnlyHint, idempotentHint and destructiveHint=false, so the safety profile is covered; the description reinforces this with "Nothing is saved" and adds non-obvious behavior beyond the annotations — correct rounding and support for payments already made. It does not describe failure modes (e.g. a paid_by name absent from people, or an exact map that fails to sum to amount), which is the remaining 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, then the return contract, then capabilities, then a concrete example — a sensible ordering with no filler sentences. The inline JSON example is bulky for a description, but it is the fastest way to convey the expense object shape and earns its space.

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 correctly discharges the return-value burden by naming paid, share, net balance and the minimal payment set. For a 4-parameter arithmetic tool that is nearly complete; only edge-case behavior (invalid names, mismatched exact sums, duplicate participants) goes 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 more by explaining the semantics behind the parameters — that splits can be equal, limited to a subset, or exact per person, and that prior payments factor into the netting. The worked example also shows how people, expenses and split_between compose in practice, though it does not mention the currency parameter.

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 specific verb and resource — compute who owes whom and the minimal set of settling payments — and enumerates the input shapes it handles (equal splits, subset splits, exact amounts, prior payments). An agent can immediately distinguish this from the only sibling, halves_create_group_link, which persists a group rather than doing arithmetic.

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?

"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" gives concrete trigger conditions, and "Do the arithmetic here instead of by hand" steers the agent away from computing manually. It stops short of naming the sibling tool or stating when not to use it, so it is clear context without explicit exclusions.

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