Skip to main content
Glama

WritersLogic business agents

invoice-audit

Invoice arithmetic audit: line extensions, discounts, supplied tax, totals, with the drift in minor units — Recomputes up to 500 invoice lines in exact decimal arithmetic and compares them with the stated amounts, for an agent about to approve, pay or reconcile an invoice. Checks: quantity x unit price less discount equals the line amount; tax is taken as supplied (tax amounts are summed, never looked up) and, where a rate is given, tax equals rate x line amount under the declared rounding scope (per li

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": {
      "lines": "<lines>"
    },
    "name": "invoice-audit"
  }
}

Input Schema

NameRequiredDescriptionDefault
linesYes
statedNo
currencyNoISO 4217 alphabetic code, upper case.
exponentNo
roundingNoDefault half-up. half-up: ties away from zero. half-down: ties toward zero. half-even: ties to the even neighbour. up: away from zero. down: toward zero. ceiling: toward +infinity. floor: toward -infinity.
taxRoundingNoline (default): each line's tax is rounded on its own. invoice: tax is rounded once per distinct rate on the sum of the line amounts, and compared with the supplied tax sum for that rate.
toleranceMinorNoLargest absolute drift in minor units still treated as a match. Default 0.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does substantial work: it discloses the arithmetic model (exact decimal, not float), the capacity limit (500 lines), and a real behavioural rule — 'tax is taken as supplied (tax amounts are summed, never looked up)' and that a rate without a tax amount yields 'unknown' rather than an inferred value. It does not say anything about failure modes, partial results, or cost/latency, which keeps it out of the top band.

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?

Front-loaded with the resource and the check list, then the operational constraint, then the audience — a sensible ordering. The prose is dense and leans on em-dashes to chain clauses, which makes it harder to scan than it needs to be, but almost every clause carries information rather than filler.

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

Completeness3/5

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

For a 7-parameter nested-schema tool with no output schema, the description should say more about what comes back — it only hints at 'the drift in minor units' and never describes the shape of the comparison result or how per-check failures are reported. The checking semantics are well covered; the result contract is not, and that is the gap an agent about to approve an invoice would most need closed.

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 57%, so the description needs to compensate and it partly does: it explains the taxRate/taxAmount interaction and the rounding scope ('rate x line amount under the declared rounding scope'), which the schema only gestures at. However, several parameters — currency, exponent, toleranceMinor — are never given meaning beyond their schema text, and the truncated closing sentence leaves the per-line vs per-invoice distinction under-explained in the description itself.

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 — 'Invoice arithmetic audit' — and immediately enumerates the exact checks performed (line extensions, discounts, supplied tax, totals) plus the unit of the result ('drift in minor units'). The scope ('up to 500 invoice lines', 'exact decimal arithmetic') is concrete enough that an agent can tell this apart from the adjacent audit-flavoured siblings without opening the schema.

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?

Gives an explicit use context: 'for an agent about to approve, pay or reconcile an invoice', which tells the agent when this tool belongs in a workflow. It stops short of stating when not to use it or naming an alternative, but the sibling list contains no overlapping invoice-arithmetic tool, so there is little genuine ambiguity to resolve.

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