Skip to main content
Glama

ScorpTech x402 Tools

Invoice Total

invoice_total
Read-onlyIdempotent

Invoice math in exact cents. Each line is quantity × unit price, then an optional line discount, rounded half away from zero to the cent. An invoice-level discount comes off the subtotal, then tax is that percent of the discounted subtotal, rounded the same way. Returns every line, the subtotal, discount, tax, and total. A discount larger than the amount it applies to is rejected. Returns JSON with: lines, lineCount, subtotal, discount, taxable, tax, total, method. Price: $0.002 USDC per successful call (x402, Base or Solana). Same tool over HTTPS: POST https://scorptech.it.com/api/x402/v1/invoice-total

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_total"
  }
}

Input Schema

NameRequiredDescriptionDefault
linesYesEach line: qty, unitPrice, optional description and discountPct
taxPctNoTax percent of the discounted subtotal, default 0
discountPctNoInvoice discount percent off the subtotal, default 0
discountAmountNoInvoice discount as money, instead of discountPct

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive and open-world, and the description adds substantial context on top: the rounding rule (half away from zero), the order of operations, the rejection rule for oversized discounts, the exact return fields, and pricing/auth mechanics (x402, USDC, plus an HTTPS fallback). The remaining gap is that it never says what an error response looks like when the discount check fails.

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 computation model, then rounding, then returns, then commercial details — a sensible order with no filler sentences. The middle sentences are dense and run long, packing order-of-operations, rounding and validation into a single block, but every clause carries information.

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?

There is no output schema, but the description enumerates the return keys (lines, lineCount, subtotal, discount, taxable, tax, total, method) so the response shape is fully predictable. Combined with the rounding rule, validation behavior, item limits from the schema and the pricing/transport details, nothing material is missing for a caller.

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 the baseline is 3, but the description earns extra credit by clarifying the interaction between parameters — the invoice discount comes off the subtotal and tax applies to the discounted subtotal, and line discounts are applied per line before rounding. It does not state whether discountAmount takes precedence over discountPct when both are supplied, which is the one ambiguity an agent would hit.

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 math in exact cents — and immediately defines the computation model (line = qty × unit price, optional line discount, invoice-level discount, then tax). An agent knows exactly what this tool computes 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 Guidelines3/5

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

Usage is implied by the domain (compute an invoice total from line items) rather than stated. There are no explicit when-to-use/when-not statements and no named alternatives, though the sibling list is unrelated number-theory tools so there is little to route between. The precise algorithm definition does make the applicable scope inferable.

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