Skip to main content
Glama

Get invoice totals

get_invoice_totals
Read-onlyIdempotent

Sums the issued invoices (or proformas) of a company dated in a period, per currency: count, net, VAT, gross, paid, unpaid and overdue. Drafts and cancelled documents are not counted.

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": {
      "company_id": "<company_id>",
      "date_from": "<date_from>",
      "date_to": "<date_to>"
    },
    "name": "get_invoice_totals"
  }
}

Input Schema

NameRequiredDescriptionDefault
typeNoThe document type to sum; INVOICE when not given. Proformas count when issued or converted to an invoice.
date_toYesLast day of the period, YYYY-MM-DD, included; the period is at most 366 days long.
date_fromYesFirst day of the period, YYYY-MM-DD.
company_idYesThe id of the company, from list_companies.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint and non-destructive behavior, so the safety profile is covered. The description adds genuinely non-obvious semantics beyond that: drafts and cancelled documents are not counted, and proformas only count when issued or converted. It does not explain handling of partially paid or multi-currency rounding, but the core counting rules are disclosed.

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?

Two sentences, no filler. The core behavior and output metrics come first, and the exclusion rule follows as a compact qualifier — everything earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an aggregation tool with no output schema, the description usefully enumerates the returned metrics and the currency grouping, which is exactly what an agent needs to decide if the result fits. Minor gaps remain around paid/unpaid/overdue definitions, but nothing essential for correct invocation is missing.

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 baseline is 3. The description goes further by introducing the 'per currency' grouping dimension, which is not expressed anywhere in the schema, and by elaborating the enum meaning for PROFORMA (counts when issued or converted), adding real meaning beyond the enum's own text.

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 precise verb (sums), a precisely bounded resource set (issued invoices or proformas of a company within a period), and the output dimensions (count, net, VAT, gross, paid, unpaid, overdue, per currency). This is clearly an aggregation tool, distinguishable from per-document siblings such as get_invoice without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description defines the data scope well (issued invoices/proformas only, drafts and cancelled excluded), which implies when the tool applies. However, it never routes the agent against alternatives (e.g. when to fetch a single invoice with get_invoice instead), so the when-to-use guidance remains implicit.

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