Skip to main content
Glama

Invoice Total

invoice_total
Read-onlyIdempotent

Total an invoice: per-line totals, subtotal, discount, tax, grand total. FREE.

Typical input {"line_items": [{"desc": "Design", "qty": 2, "unit_price": 50}], "tax_pct": 8.5, "discount_pct": 10} returns {"lines": [{"desc": "Design", "qty": 2, "unit_price": 50, "line_total": 100.0}], "subtotal": 100.0, "discount": 10.0, "tax": 7.65, "total": 97.65}.

Use when several line items roll up with discount and tax. Not for one transaction's fees (processor_fees) and not for spreading a total over time (installment_plan). Errors: on invalid, missing, or malformed input this tool never raises a protocol error — it returns {"error": ""} (for example {"error": "line_items must contain at least one item,"}). Every call is read-only and idempotent, so after correcting the input it is always safe to retry.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tax_pctNoTax percentage applied after the discount, e.g. 8.5. Default 0.
line_itemsYesAt least one line item object {"desc": str, "qty": number, "unit_price": number}; the first 100 items are used.
discount_pctNoDiscount percentage applied to the subtotal. Default 0.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already indicate readOnlyHint=true, idempotentHint=true, destructiveHint=false. The description adds value by confirming 'Every call is read-only and idempotent' and detailing error handling: 'this tool never raises a protocol error — it returns {"error": "..."}' plus a safe-to-retry guarantee. This goes beyond the annotations, but stops short of explaining rate limits or other potential constraints.

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?

The description is front-loaded with the core purpose and includes a compact JSON example. All sentences add value. It could be slightly more concise by omitting the repeated 'FREE.' tagline, but overall it is well-structured and efficient.

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?

The description covers purpose, usage guidelines, parameter behavior via example, error handling, safety guarantees, and clearly distinguishes from siblings. With annotations covering safety, an output schema present, and 100% schema coverage, the description is fully complete for the complexity of this tool.

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 100%, so the input schema already documents all three parameters. The description provides a typical usage example showing how parameters map to output, which adds practical context but does not add new semantic meaning beyond what the schema provides. Baseline 3 is appropriate.

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?

The description clearly states 'Total an invoice: per-line totals, subtotal, discount, tax, grand total.' It specifies the verb (total) and the resource (invoice), and distinguishes it from sibling tools like processor_fees and installment_plan by explicitly mentioning what it is not for.

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

Usage Guidelines5/5

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

The description explicitly says 'Use when several line items roll up with discount and tax. Not for one transaction's fees (processor_fees) and not for spreading a total over time (installment_plan).' This provides clear when-to-use and when-not-to-use guidance, naming specific sibling alternatives.

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.