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

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already provide readOnlyHint=true, idempotentHint=true, and destructiveHint=false. The description adds value by affirming read-only and idempotent behavior: 'Every call is read-only and idempotent, so after correcting the input it is always safe to retry.' It also discloses error handling: never raises a protocol error but returns an error object with fix instructions.

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 well-structured: purpose first, then example, usage guidance, error info, and safety note. While it includes an example and error details which are helpful, it is slightly longer than necessary. Still, every sentence serves a clear purpose.

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?

Given the tool's moderate complexity (3 parameters, output schema exists), the description covers purpose, usage context, error behavior, idempotency, and provides a full example. It leaves no obvious gaps for an AI agent to operate 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?

Schema coverage is 100%, so baseline is 3. The description adds a concrete input example with line_items, tax_pct, discount_pct and shows the output format, which enhances understanding of parameter relationships. However, the schema already describes all parameters well, so the description provides moderate added value.

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 the tool's purpose: 'Total an invoice: per-line totals, subtotal, discount, tax, grand total.' It provides a specific verb and resource, and distinguishes itself from sibling tools by explicitly naming what it is not for (processor_fees, installment_plan).

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 states when to use: 'Use when several line items roll up with discount and tax.' It also lists alternatives: 'Not for one transaction's fees (processor_fees) and not for spreading a total over time (installment_plan).' Additionally, it explains error behavior and retry safety.

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.

TDQS

A4.6/5.0
Disambiguation5/5

Each tool serves a distinct pricing/financial calculation: gross-up from net (charge_to_net), stacking discounts (discount_stack), installment schedules (installment_plan), invoice totals (invoice_total), processor fee breakdown (processor_fees), and proration (proration). Even closely related tools like charge_to_net and processor_fees are clearly inverses, with descriptions explicitly noting when to use one versus the other.

Naming Consistency4/5

All six tool names use a clear noun or noun phrase with underscores, following a consistent pattern (e.g., charge_to_net, discount_stack, installment_plan). The only minor deviation is that some names are verb-first (charge_to_net) while others are noun-first (processor_fees), but the pattern is predictable and readable.

Tool Count5/5

With six tools, the set is well-scoped for a merchant/pricing MCP server. Each tool covers a common financial calculation need (fees, discounts, installments, invoicing, proration) without bloat. The count is lean yet sufficient for its domain.

Completeness4/5

The tool set covers core merchant calculations: gross-up, fee breakdown, discount stacking, installment plans, invoice totaling, and proration. Minor gaps include missing currency conversion or tax jurisdiction handling, but for a focused pricing/fee calculator the coverage is solid.

Resources