Skip to main content
Glama

Preview a settlement

settlement_preview
Read-onlyIdempotent

Preview debt settlement between two flat members: net, settleable and remaining cents plus affected splits, with no data changes. Verify before committing a payment.

Instructions

Computes, without changing anything, what settling the debt from fromMemberId to toMemberId would cover: netCents (net debt), settleableCents, remainingCents and the affected splits. Call it before settlement_commit (pass the result as expected) or cash_payment_record (use netCents as expectedNetCents). For a quick overview of what others owe the caller use balances_get instead. The caller must be one of the two members (otherwise not_party_to_debt); both must be active in the flat (member_not_in_wg).

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>"
    },
    "name": "settlement_preview"
  }
}

Input Schema

NameRequiredDescriptionDefault
wgCodeNoShare code of the flat (code from wg_list). Leave it out when the account belongs to one flat.
currencyNoCurrency of the debt to preview.EUR
toMemberIdYesMember who is owed the money and receives it, from members_list.
fromMemberIdYesMember who owes the money and pays, from members_list.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.1.1
    • addedInput schema / properties / currency / description
      Added value: +"Currency of the debt to preview."
    • addedInput schema / properties / fromMemberId / description
      Added value: +"Member who owes the money and pays, from members_list."
    • addedInput schema / properties / toMemberId / description
      Added value: +"Member who is owed the money and receives it, from members_list."
  2. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, but the description adds real behavior beyond them: the caller must be one of the two members, both must be active in the flat, and the specific failure codes (not_party_to_debt, member_not_in_wg). This tells the agent what preconditions to verify and how failures will surface.

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?

Two dense sentences that front-load the core computation and outputs, then the routing guidance, then the guardrails — a sound order with little waste. Minor cost: a run-on construction and the typo 'from fromMemberId' slightly hurt readability, but no sentence is padding.

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?

There is no output schema, yet the description names the returned fields and their meaning, plus the precondition errors. For a 4-parameter read-only preview with full schema coverage, nothing an agent needs to call it correctly and interpret the result 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 field-level meaning of fromMemberId, toMemberId, wgCode and currency is already documented in the schema. The description reinforces the payer/payee direction but adds no new syntax, defaults, or edge-case semantics beyond what the schema provides, so the baseline 3 applies.

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 ('Computes ... what settling the debt from fromMemberId to toMemberId would cover') and enumerates the exact outputs (netCents, settleableCents, remainingCents, affected splits). It also explicitly distinguishes itself from settlement_commit, cash_payment_record and balances_get, so an agent can route correctly without opening other schemas.

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?

Gives explicit sequencing guidance: call this before settlement_commit and pass the result as expected, or use netCents as expectedNetCents for cash_payment_record. It also names the excluded alternative ('For a quick overview of what others owe the caller use balances_get instead'), leaving nothing to inference.

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