Skip to main content
Glama

Aged balances

aged-balances
Read-onlyIdempotent

Receivables or payables aged at a date: who owes the company and how late it is, or whom it owes and when.

WHEN TO USE:

  • "Who owes us money?", "what's overdue?", "whom do we owe, and when is it due?"

  • Month-end review: the aging at the month-end date, and each entity's open items tied out to its receivables or payables account

  • One counterparty's open invoices or bills: pass agent_id

PARAMETERS:

  • kind (required): receivables or payables

  • as_of (optional, YYYY-MM-DD): the date to age at; omit for today. A payment dated after it has not happened yet

  • entity_id (optional): omit for the group parent

  • scope (optional, default entity): group sums the parent and the members consolidated in full, and sets apart what they owe each other

  • agent_id (optional): that counterparty's open items instead of the summary

RETURNS: Amounts are in cents.

  • Without agent_id: buckets (current, 1–30, 31–60, 61–90 and over 90 days past due, and unapplied credit from overpayments), agents (a row per counterparty, largest first), defaulted_due_date_count (items with no due date of their own, aged as due on receipt), and tie_outs: each entity's open items against its control accounts, with difference_cents named and never plugged; pending_close_cents is what the close will post from documents already counted (a payment committed in an open month), so it is not a difference. For a group, intercompany holds the items the members owe each other, and pairs sets both sides of each pair side by side.

  • With agent_id: items, oldest first, each with its due date, due_date_basis, days past due and bucket.

RELATED TOOLS:

  • agent-activity — a counterparty's events and transactions

  • update-event-block — correct an invoice's or bill's due_date

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": {
      "kind": "<kind>"
    },
    "name": "aged-balances"
  }
}

Input Schema

NameRequiredDescriptionDefault
kindYes
as_ofNoThe date to age at, YYYY-MM-DD. Omit for today.
scopeNoentity
agent_idNoOne counterparty (agt_ prefixed).
entity_idNoThe entity whose books this acts on, by id (get-graph-info lists them). Omit for the group parent.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already establish read-only, idempotent, non-destructive behavior, and the description adds real semantic context beyond them: amounts in cents, that as_of is a hard cut-off ('a payment dated after it has not happened yet'), that difference_cents is never plugged, and that pending_close_cents is not a difference. The only missed opportunity is any statement of permissions or volume/performance limits.

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?

Header-delimited sections with the one-line purpose front-loaded make this scannable, and most sentences carry information an agent would otherwise have to guess. The RETURNS prose is dense, with the tie_outs sentence running long, which keeps it just shy of a 5.

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, so the description takes on the return-value burden and discharges it: it enumerates the bucket boundaries, the agents row ordering, tie_outs semantics, and the alternate item-level shape under agent_id. For a 5-parameter reporting tool, an agent has everything needed to select and call it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With schema coverage at 60%, the description compensates well: it explains that omitting entity_id means the group parent, that scope=group consolidates members in full and separates intercompany, that agent_id switches the output shape entirely, and that omitting as_of means today. These are behavioral consequences the enum and type definitions cannot convey.

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?

The opening line names a specific verb+resource ('receivables or payables aged at a date') and immediately disambiguates it in plain language ('who owes the company and how late it is, or whom it owes and when'). The RELATED TOOLS section names the closest siblings (agent-activity, update-event-block) and says what they do instead.

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?

The WHEN TO USE block gives three concrete triggers, including the actual user questions the tool answers ('who owes us money?', 'what's overdue?'), a month-end review scenario, and the single-counterparty case routed through agent_id. It also names alternatives, which is the explicit routing an agent needs.

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.