Skip to main content
Glama

Settle up

settle_up
Read-onlyIdempotent

Given a shared total and who already paid what, compute each player's balance and the minimal set of payments (who pays whom, how much) to settle everyone. Use when the question is 'who owes whom'. For recurring sessions with different attendees use split_series.

Input Schema

NameRequiredDescriptionDefault
sharesNoOptional positive relative weights, one per participant in the same order, e.g. [2,1,1]; omit for an equal split
currencyNoCurrency code used only for display, e.g. USD, EUR, GBP (default USD)
total_costYesTotal court/venue cost in currency units, e.g. 96 for $96.00
participantsYesAt least 2 players with unique names; include 'paid' for anyone who already paid, e.g. [{"name":"Asha","paid":96},{"name":"Dev"}]

Output Schema

NameRequiredDescriptionDefault
noteYesPlain-language summary of the settlement
balancesYesPer-player paid, owed share and net balance
currencyYesCurrency code used for display
transfersYesMinimal list of payments that settles the group
total_costYesTotal shared cost, rounded to cents
transfer_countYesNumber of payments in transfers

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed11 schema fields changed
    • changedInput schema / properties / currency / description
      Previous value: -"Currency code, as a string, ISO 4217"New value: +"Currency code used only for display, e.g. USD, EUR, GBP (default USD)"
    • changedInput schema / properties / participants / description
      Previous value: -"List of participant names, as strings in an array"New value: +"At least 2 players with unique names; include 'paid' for anyone who already paid, e.g. [{\"name\":\"Asha\",\"paid\":96},{\"name\":\"Dev\"}]"
    • addedInput schema / properties / participants / items / properties / name / description
      Added value: +"Player name, unique within the list, e.g. 'Asha'"
    • addedInput schema / properties / participants / items / properties / paid / description
      Added value: +"Amount this player already paid toward the total, in currency units (default 0)"
    • addedInput schema / properties / participants / items / properties / paid / minimum
      Added value: +0
    • addedInput schema / properties / participants / minItems
      Added value: +2
    • changedInput schema / properties / shares / description
      Previous value: -"Each participant's share of the total cost, as numbers in an array"New value: +"Optional positive relative weights, one per participant in the same order, e.g. [2,1,1]; omit for an equal split"
    • addedInput schema / properties / shares / items / exclusiveMinimum
      Added value: +0
    • changedInput schema / properties / total_cost / description
      Previous value: -"Total amount spent, as a number"New value: +"Total court/venue cost in currency units, e.g. 96 for $96.00"
    • addedInput schema / properties / total_cost / exclusiveMinimum
      Added value: +0
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "balances": {
      +      "description": "Per-player paid, owed share and net balance",
      +      "items": {
      +        "properties": {
      +          "balance": {
      +            "description": "paid minus owed; positive = gets money back, negative = owes money",
      +            "type": "number"
      +          },
      +          "name": {
      +            "description": "Player name",
      +            "type": "string"
      +          },
      +          "owed": {
      +            "description": "This player's fair share of the cost",
      +            "type": "number"
      +          },
      +          "paid": {
      +            "description": "Amount this player paid",
      +            "type": "number"
      +          }
      +        },
      +        "required": [
      +          "name",
      +          "paid",
      +          "owed",
      +          "balance"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "currency": {
      +      "description": "Currency code used for display",
      +      "type": "string"
      +    },
      +    "note": {
      +      "description": "Plain-language summary of the settlement",
      +      "type": "string"
      +    },
      +    "total_cost": {
      +      "description": "Total shared cost, rounded to cents",
      +      "type": "number"
      +    },
      +    "transfer_count": {
      +      "description": "Number of payments in transfers",
      +      "type": "integer"
      +    },
      +    "transfers": {
      +      "description": "Minimal list of payments that settles the group",
      +      "items": {
      +        "properties": {
      +          "amount": {
      +            "description": "Amount to transfer, rounded to cents",
      +            "type": "number"
      +          },
      +          "from": {
      +            "description": "Player who pays",
      +            "type": "string"
      +          },
      +          "to": {
      +            "description": "Player who receives",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "from",
      +          "to",
      +          "amount"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "currency",
      +    "total_cost",
      +    "balances",
      +    "transfers",
      +    "transfer_count",
      +    "note"
      +  ],
      +  "type": "object"
      +}
  2. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -{
      -  "properties": {
      -    "balances": {
      -      "description": "The net balance for each participant after settling up.",
      -      "items": {
      -        "properties": {
      -          "balance": {
      -            "description": "The net balance for the participant.",
      -            "type": "number"
      -          },
      -          "name": {
      -            "description": "The name of the participant.",
      -            "type": "string"
      -          }
      -        },
      -        "required": [
      -          "name",
      -          "balance"
      -        ],
      -        "type": "object"
      -      },
      -      "type": "array"
      -    },
      -    "transactions": {
      -      "description": "The minimal set of transactions to settle up all balances.",
      -      "items": {
      -        "properties": {
      -          "amount": {
      -            "description": "The amount being transferred.",
      -            "type": "number"
      -          },
      -          "from": {
      -            "description": "The name of the participant paying.",
      -            "type": "string"
      -          },
      -          "to": {
      -            "description": "The name of the participant receiving.",
      -            "type": "string"
      -          }
      -        },
      -        "required": [
      -          "from",
      -          "to",
      -          "amount"
      -        ],
      -        "type": "object"
      -      },
      -      "type": "array"
      -    }
      -  },
      -  "required": [
      -    "balances",
      -    "transactions"
      -  ],
      -  "type": "object"
      -}New value: +null
  3. Changed4 schema fields changed
    • addedInput schema / properties / currency / description
      Added value: +"Currency code, as a string, ISO 4217"
    • addedInput schema / properties / participants / description
      Added value: +"List of participant names, as strings in an array"
    • addedInput schema / properties / shares / description
      Added value: +"Each participant's share of the total cost, as numbers in an array"
    • addedInput schema / properties / total_cost / description
      Added value: +"Total amount spent, as a number"
  4. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "balances": {
      +      "description": "The net balance for each participant after settling up.",
      +      "items": {
      +        "properties": {
      +          "balance": {
      +            "description": "The net balance for the participant.",
      +            "type": "number"
      +          },
      +          "name": {
      +            "description": "The name of the participant.",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "name",
      +          "balance"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "transactions": {
      +      "description": "The minimal set of transactions to settle up all balances.",
      +      "items": {
      +        "properties": {
      +          "amount": {
      +            "description": "The amount being transferred.",
      +            "type": "number"
      +          },
      +          "from": {
      +            "description": "The name of the participant paying.",
      +            "type": "string"
      +          },
      +          "to": {
      +            "description": "The name of the participant receiving.",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "from",
      +          "to",
      +          "amount"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "balances",
      +    "transactions"
      +  ],
      +  "type": "object"
      +}
  5. First observed

TDQS

A4.1/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, non-destructive, and closed-world, so the safety profile is fully covered structurally. The description adds only that the output is a minimal payment set, which is also implied by the output schema, so incremental behavioral disclosure is modest.

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: the core computation first, then the routing rule. No filler, no repetition of the schema, and the most decision-relevant content is front-loaded.

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?

An output schema exists, so return values need not be described; annotations carry the safety profile; the schema fully documents all four parameters. Nothing an agent needs to select or call this tool 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 description coverage is 100%, so the baseline is 3; the schema already documents total_cost, participants, paid, shares, and currency with examples. The description restates the total/paid concept but adds no format or edge-case detail beyond 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?

States a specific computation: given a total and prior payments, compute balances and the minimal settlement payments. That verb+resource phrasing makes it immediately distinguishable from split_costs/split_series, which partition a cost rather than net out balances.

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?

Explicitly gives the trigger ('Use when the question is "who owes whom"') and routes one alternative (split_series for recurring sessions with different attendees). It does not differentiate against split_costs or rotation_plan, which are plausible near-neighbors, so it falls short of a full when/when-not map.

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