Skip to main content
Glama

WritersLogic verifiable AI 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

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources