Skip to main content
Glama

mechacut

invoice_validate_totals

Audit DECLARED invoice numbers against the arithmetic the document itself asserts: amount == qty x unit_price per line, sum of line bases == subtotal, subtotal - discount + tax == total, declared tax vs line tax_rate under BOTH published rounding methods (aggregate / per-line; the match is NAMED). Exact Decimal cent-level, signed deltas, verdict OK or CONTRADICTED. Numbers are never corrected — a corrected claim destroys the evidence it was wrong. Computing an invoice is another contract (recipe/invoice). Blind spot published: an internally consistent wrong number stays invisible. 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": {
      "lines": "<lines>",
      "declared": "<declared>"
    },
    "name": "invoice_validate_totals"
  }
}

Input Schema

NameRequiredDescriptionDefault
linesYes
currencyNoechoed label only, never computed with
declaredYes
tax_modeNoexclusive (default) | inclusive

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/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 so richly: it discloses that numbers are never corrected and why, the OK/CONTRADICTED verdict, signed deltas, cent-level Decimal precision, dual rounding-method matching with the match named, and an explicit published blind spot (an internally consistent wrong number stays invisible). It stops short of stating idempotency/read-only status or input-error behavior, but for a pure validation tool the disclosure is well above average.

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 core contract and dense with meaningful detail, so most sentences earn their place; parenthetical asides and the trailing 'Free.' are minor noise. It is long but information-rich rather than padded.

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 a nested-object, multi-parameter tool with no output schema, the description explains the expected result shape (verdict plus signed deltas, both rounding matches named) and even a known limitation. Coverage of tax_mode semantics and error conditions is thin, but an agent has enough to call it correctly.

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?

At 50% schema coverage, the description compensates by explaining what the parameters mean relationally: lines' qty/unit_price/amount are checked against each other, declared subtotal/discount/tax/total are cross-checked, and line tax_rate is compared to declared tax. It does not clarify tax_mode (exclusive/inclusive) or currency beyond the schema's own notes, leaving some param meaning to the schema.

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 (audit/validate) applied to a named resource (DECLARED invoice numbers) and enumerates the exact arithmetic identities checked (amount == qty x unit_price, sum of bases == subtotal, subtotal - discount + tax == total). It also explicitly distinguishes itself from invoice computation ('Computing an invoice is another contract'), so an agent can tell it apart from a compute tool 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 clear context for when to use it (auditing declared numbers that already exist) and names the contrasting alternative contract (recipe/invoice) for computing an invoice. It lacks an explicit 'do not use when…' exclusion, but the compute-vs-audit split is stated plainly.

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.