Skip to main content
Glama

List discharge candidates

list-discharge-candidates
Read-onlyIdempotent

The open invoices or bills a payment or bank line may settle, best match first.

WHEN TO USE:

  • Before committing a bank line that pays a bill or collects an invoice: a person picks the items it settles from these

  • "Which invoice does this deposit pay?"

PARAMETERS:

  • event_id (required): the payment or bank line

RETURNS: event_id, kind (receivables for money in, payables for money out), amount_cents, classified_to_control (whether the line is classified to a receivables or payables account), and candidates: the open items of the line's own entity and counterparty at its date, an exact amount match first, then the oldest due date, each with its open_cents, due date and days past due.

NOTES:

  • Settling is a person's choice: record it on the commit with discharge_allocations: [{obligation_event_id, amount}] on update-event-block, several for a split. A line with no pick commits as it is, and its bill stays open

RELATED TOOLS:

  • update-event-block — commit the line with its settlement

  • aged-balances — every open item, aged

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": {
      "event_id": "<event_id>"
    },
    "name": "list-discharge-candidates"
  }
}

Input Schema

NameRequiredDescriptionDefault
event_idYesThe payment or bank line (event id).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already cover read-only, idempotent and non-destructive, and the description goes well beyond them: it discloses the candidate ranking algorithm (exact amount match, then oldest due date), the filtering scope (line's own entity and counterparty at its date), and the classified_to_control guard. It also makes clear this tool mutates nothing — the human picks the settlement, which is recorded elsewhere — which is exactly the behavioral context an agent needs before calling.

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?

Sectioned with bold headers and front-loaded with the one-line purpose; every block (when, params, returns, notes, related) maps to something an agent needs. The RETURNS prose is dense but justified by the absence of an output schema. Minor cost: the opening line is a fragment and the returns sentence packs five ideas into one.

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?

No output schema exists, so the description supplies the full return shape including kind, amount_cents, classified_to_control and the candidate fields with open_cents and days past due. It also closes the loop by explaining what happens if no pick is made (the line commits as-is and the bill stays open). Nothing needed to invoke or interpret 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?

With one parameter at 100% schema coverage, the schema already defines event_id as the payment or bank line. The description's PARAMETERS block repeats that verbatim and adds no format, sourcing, or validation detail. Baseline 3 applies since the schema carries the burden.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The lead sentence names the exact resource — open invoices/bills a given payment or bank line may settle — and states the ordering (best match first). It is a noun phrase rather than an explicit verb, but combined with the WHEN TO USE questions it is unambiguous. It implicitly separates itself from aged-balances by being scoped to one line's counterparty/entity rather than all open items.

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?

Explicit WHEN TO USE bullets give both the workflow trigger (before committing a bank line) and a natural-language user intent ('Which invoice does this deposit pay?'). The NOTES section states the critical follow-up behavior — settlement must be recorded via update-event-block with discharge_allocations — and RELATED TOOLS names both the commit tool and the broader alternative (aged-balances for every open item).

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.