Skip to main content
Glama

statement_prepare

Read-only

A client's statement of account over a period of the business's own days (the sales_settings time zone): the balance they owed before it (opening), each invoice issued, payment received, credit and write-off in it with a running balance, the balance at its end (closing), and what was still owed at its end aged current / 1-30 / 31-60 / 61-90 / over 90 days past due, counted as sales_receivables counts. Only issued invoices count: drafts and cancelled invoices never do. Money is integer CENTS in each invoice's own currency, one section per currency, never converted or added across currencies; read the figures as given. It prepares nothing and sends nothing: returns the figures, document_path (the print-ready page, while signed in) and pdf_next_call (the statement_pdf call that makes the PDF). A statement with more than 150 rows lists its first rows, whole business days only, and lines_cut says which and gives the next_call that lists the rest; the balances, totals and ageing always cover the whole period. When the result has a second content block, it is the statement as copy-ready text (a very long one shortened), and hosts that draw MCP Apps show the statement with a Copy button, as plain text when it is too long to draw as a document. Refusals: a client_id that is not one of your clients is NOT_FOUND (find it with invoice_client_search or invoice_client_list); a date not written YYYY-MM-DD, a to after today, a from after to, or a period longer than 366 days is VALIDATION_ERROR naming the field; a client with more than 2000 issued invoices is PAYLOAD_TOO_LARGE SIMPLER_SALES_STATEMENT_TOO_LARGE (sales_receivables still ages them). Free.

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": {
      "client_id": "<client_id>"
    },
    "name": "statement_prepare"
  }
}

Input Schema

NameRequiredDescriptionDefault
toNoLast day of the period, YYYY-MM-DD in the business's time zone, today at the latest. Default: today.
fromNoFirst day of the period, YYYY-MM-DD in the business's time zone. Default: the first day of the month of to.
client_idYesThe client's id, from invoice_client_search (by name) or invoice_client_list.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=true, but the description goes far beyond that: money is integer cents per currency and never converted, only issued invoices count (drafts/cancelled excluded), the 150-row truncation with whole-business-day cuts and lines_cut/next_call, the optional second content block as copy-ready text, MCP Apps rendering with a Copy button, and that the tool is free. It also names the exact error codes and their triggering conditions (NOT_FOUND, VALIDATION_ERROR per field, PAYLOAD_TOO_LARGE).

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?

It is a single dense paragraph of roughly 200 words, but nearly every clause carries distinct operational information rather than restating the name. Front-loading is reasonable — the content of the statement comes first and the refusals last — though the key 'returns figures only, prepares nothing' disclaimer sits mid-paragraph where it would be more valuable up front.

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 carries the full burden of describing return values, and it does: the per-currency sections, cents convention, ageing buckets tied to sales_receivables, document_path, pdf_next_call, lines_cut and the secondary text content block. Combined with explicit failure modes, an agent has everything needed to call this correctly and interpret the result.

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% and already documents client_id, from and to including defaults, so the baseline is 3. The description adds semantics not in the schema: dates are interpreted in the business's own sales_settings time zone, periods longer than 366 days are rejected, and a from after to or a to after today is a VALIDATION_ERROR naming the field — genuine added meaning over the parameter definitions.

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 description precisely enumerates what the statement contains (opening balance, invoices, payments, credits, write-offs, running balance, closing, ageing buckets) and explicitly disclaims action: 'It prepares nothing and sends nothing: returns the figures.' The only weakness is that the opening is a long noun phrase rather than a verb+resource statement, so the actual operation surfaces several clauses in. It does, however, clearly separate itself from statement_pdf and sales_receivables.

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?

It routes the agent to alternatives in several concrete cases: use invoice_client_search or invoice_client_list to obtain a valid client_id, follow up with statement_pdf (via pdf_next_call) to get the PDF, and fall back to sales_receivables when a client exceeds 2000 issued invoices. It never states a condition where a different statement-ish tool should be preferred over this one in the normal case, so it stops short of full when/when-not guidance.

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