Skip to main content
Glama

Commit a settlement

settlement_commit

Settles multiple open splits from a prior preview for a debt between two members in one step; pass the preview result unchanged, and re-preview if debts changed and the call returns 409.

Instructions

Marks the open splits listed by a settlement_preview as settled in one step, for the debt from fromMemberId to toMemberId. Run settlement_preview first and pass its result unchanged as expected; if the debts changed in between, the call fails with 409 settlement_changed, then preview again. Use it to settle several shares at once; for one share use expense_split_settle, to record a cash payment over the whole net debt use cash_payment_record. The caller must be one of the two members (otherwise not_party_to_debt). Moves no money. Notifies the other member and writes an audit entry.

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": {
      "fromMemberId": "<fromMemberId>",
      "toMemberId": "<toMemberId>",
      "currency": "<currency>",
      "expected": "<expected>"
    },
    "name": "settlement_commit"
  }
}

Input Schema

NameRequiredDescriptionDefault
wgCodeNoShare code of the flat (code from wg_list). Leave it out when the account belongs to one flat.
currencyYesCurrency of the debt to settle. Debts in different currencies are settled separately.
expectedYesThe settlement_preview result for the same members and currency, passed back unchanged. It proves what the caller reviewed; extra keys such as remainingCents are ignored.
toMemberIdYesMember who is owed the money; same value as in the preview.
fromMemberIdYesMember who owes the money and pays; same value as in the preview.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed10 schema fields changedv0.1.1
    • addedInput schema / properties / currency / description
      Added value: +"Currency of the debt to settle. Debts in different currencies are settled separately."
    • addedInput schema / properties / expected / description
      Added value: +"The settlement_preview result for the same members and currency, passed back unchanged. It proves what the caller reviewed; extra keys such as remainingCents are ignored."
    • addedInput schema / properties / expected / properties / netCents / description
      Added value: +"netCents from the preview: the net debt in cents between the two members."
    • addedInput schema / properties / expected / properties / settleableCents / description
      Added value: +"settleableCents from the preview: the part of the net debt the listed splits settle."
    • addedInput schema / properties / expected / properties / splits / description
      Added value: +"The preview splits list, copied unchanged."
    • addedInput schema / properties / expected / properties / splits / items / properties / amountCents / description
      Added value: +"Amount of this split in cents, as listed in the preview."
    • addedInput schema / properties / expected / properties / splits / items / properties / id / description
      Added value: +"Split id, from the preview splits list."
    • addedInput schema / properties / expected / properties / splits / items / properties / offset / description
      Added value: +"Copy offset from the preview when present: the split cancels a counter-debt."
    • addedInput schema / properties / fromMemberId / description
      Added value: +"Member who owes the money and pays; same value as in the preview."
    • addedInput schema / properties / toMemberId / description
      Added value: +"Member who is owed the money; same value as in the preview."
  2. First observedv0.1.0

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false, idempotentHint=false and destructiveHint=false, yet the description adds substantive context beyond that: 'Moves no money', notifies the other member, writes an audit entry, and a concrete failure mode (409 settlement_changed) with the remediation. The authorization constraint (caller must be one of the two members, else not_party_to_debt) is also spelled out. It only stops short of describing the success response body, which is minor here.

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?

Five tight sentences, front-loaded with what the tool does, then prerequisite, alternatives, authorization and side effects. No filler and no repetition of the title.

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?

For a 5-parameter mutation with a nested expected object and no output schema, the description covers the precondition, the stale-state failure, the permission requirement and the side effects (notification, audit). An agent has everything needed to call it correctly and to recover from the one documented error.

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 base is 3, and the description earns the extra point by explaining the coupling contract: 'expected' is proof of what the caller reviewed and must be echoed unchanged, which clarifies why the fromMemberId/toMemberId values must match the preview. It adds little on currency or wgCode beyond the schema's own descriptions.

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?

Opens with a specific verb and resource — marks open splits as settled in one step for the debt from fromMemberId to toMemberId — and immediately scopes the input to what settlement_preview returned. An agent can distinguish this from settlement_preview, expense_split_settle and cash_payment_record on the strength of the text alone.

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?

States the mandatory prerequisite (run settlement_preview first and pass its result unchanged) plus the recovery path when the 409 settlement_changed error occurs. It also names both alternatives with the conditions that select them: expense_split_settle for a single share, cash_payment_record for a cash payment covering the whole net debt.

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