Skip to main content
Glama

Totales de factura

invoice-total
Read-onlyIdempotent

Calcula una factura desde ítems (cantidad, precio, descuento %, impuesto %): totales por línea, subtotal, impuestos por tasa y total. Cuándo: un cálculo de dinero, impuestos o matemática financiera tiene que ser exacto y reproducible (redondeo, centavos, tasas). No para: dividir una cuenta entre personas con propina opcional y redondeo de cada parte (bill-split). Efectos secundarios: ninguno (solo lectura, sin red, sin estado guardado). Determinista: la misma entrada da la misma salida. Límites: entrada JSON de hasta 64 KB, 1 s por llamada, resultado de hasta 1 MB.

EN: Computes an invoice from line items (quantity, unit price, line discount %, tax rate %): line totals, subtotal, discount, tax grouped by rate, and grand total, rounded per line to the currency's minor units. When: a money, tax or financial-math result has to be exact and reproducible (rounding, cents, rates). Not for: splitting a bill among people with an optional tip % (bill-split). [EN completo / full EN: inputSchema.description]

Input Schema

NameRequiredDescriptionDefault
itemsYesLine items (array of object; required; at least 1 items; up to 1000 items).
currencyNoISO 4217 currency code (string; optional; default "USD"; pattern ^[A-Za-z]{3}$).USD
global_discount_percentNoDiscount % on subtotal (number; optional; default 0; min 0; max 100).

Output Schema

NameRequiredDescriptionDefault
linesNo
totalNo
currencyNo
discountNo
subtotalNo
tax_totalNo
taxable_baseNo
taxes_by_rateNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / items / examples
      Added value: +[
      +  [
      +    {
      +      "discount_percent": 10,
      +      "quantity": 3,
      +      "tax_percent": 8.25,
      +      "unit_price": 9.99
      +    }
      +  ]
      +]
  2. Changed1 schema field changed
    • addedInput schema / description
      Added value: +"EN: Computes an invoice from line items (quantity, unit price, line discount %, tax rate %): line totals, subtotal, discount, tax grouped by rate, and grand total, rounded per line to the currency's minor units. When: a money, tax or financial-math result has to be exact and reproducible (rounding, cents, rates). Not for: splitting a bill among people with an optional tip % (bill-split). Side effects: none (read-only, no network access, no stored state). Deterministic: the same input gives the same output. Limits: JSON input up to 64 KB, 1 s per call, result up to 1 MB."
  3. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already cover read-only, idempotent, non-destructive and closed-world, and the description redundantly restates 'sin efectos secundarios'. It does add real value beyond the annotations: determinism, per-line rounding to the currency's minor units, and concrete limits (64 KB input, 1 s per call, 1 MB result). Loses a point only for the annotation-repeating sentence.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose is front-loaded and each Spanish sentence earns its place, but the full content is duplicated verbatim in English, roughly doubling length, and the text ends with a dangling artifact ('[EN completo / full EN: inputSchema.description]') that reads like an unresolved template. Structurally sound, but wasteful.

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?

An output schema exists so return values needn't be described, and the description still supplies the essentials an agent needs: determinism, rounding model, currency minor units, and hard input/time/size limits. Only the truncated EN pointer keeps it from being fully self-contained.

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 schema already documents items, currency and global_discount_percent. The description adds a little meaning — tax is grouped by rate, rounding is per line to the currency's minor units — but does not explain the interaction between line discount and global discount on subtotal. 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?

States a specific verb and resource ('Calcula una factura desde ítems') and enumerates exactly what is produced: line totals, subtotal, discount, tax grouped by rate, grand total. It explicitly names the sibling it is not (bill-split), so an agent can route between them without opening either schema.

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?

Provides an explicit 'Cuándo' condition (money/tax/financial math that must be exact and reproducible) and an explicit 'No para' exclusion naming bill-split with the distinguishing condition (splitting among people with optional tip). This is the full when/when-not/alternative pattern.

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