Skip to main content
Glama

Total a set of line items with tax

calculate_totals
Read-onlyIdempotent

Adds up line items, applies discounts, and applies the tax for a country — the same arithmetic QuoteBill uses, rounded to the currency and with each tax component rounded separately.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
regionNoCanadian province or territory code (for example QC, ON). Only accepted when country is CA.
countryYesTwo-letter ISO country code of the place of supply, for example KR, JP, DE, GB.
taxRateNoTax rate as a percentage, for example 10 for 10%. Overrides the published rate. Use it where the country has no single rate, such as the United States.
lineItemsYesLine items. A row with type "header" is a section heading and is not charged.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
needsNoPresent when no total can be given until the person supplies a rate.
totalYesNull until a rate is known; never a guessed zero.
regionYes
sourceYesWhere the rate was read from, and when. Null where no official source was verified.
statusYesHow far the rate can be relied on, for example standard-rate-estimate or jurisdiction-required.
taxNameYes
taxRateYesCombined rate as a fraction, for example 0.1 for 10%. Null where the country has no single rate.
currencyYes
roundingYes
subtotalYes
checkedOnYes
lineItemsYes
taxAmountYes
componentsYes
countryCodeYes
needsReviewYes
effectiveFromYes
reviewReasonsYes
currencyDigitsYes
referenceSourceYesWhere the rate was read from, and when. Null where no official source was verified.
calculationAvailableYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false. The description adds meaningful behavioral detail beyond annotations: rounding to the currency and rounding each tax component separately, plus QuoteBill parity. There is no contradiction with the annotations.

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

Conciseness5/5

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

A single front-loaded sentence states the core action first ('Adds up line items, applies discounts, and applies the tax'), then adds a precise qualifier about rounding. Every word earns its place with no filler.

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?

With an output schema present and full parameter coverage in the schema, the description only needs to convey the calculation behavior, which it does thoroughly, including the rounding nuance. No critical behavioral aspect for invoking the tool is missing.

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 coverage is 100%, so all four parameters are already documented in detail. The description mentions applying discounts and tax for a country, which loosely maps to lineItems and country, but it adds no syntax, format, or parameter-specific meaning beyond the schema. 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 states a specific verb and resource: it 'Adds up line items, applies discounts, and applies the tax for a country.' It also distinguishes itself from siblings by referencing QuoteBill's exact arithmetic, making clear this is a calculation tool rather than a retrieval or document-building tool.

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?

The description gives clear context by noting it uses 'the same arithmetic QuoteBill uses,' implying this is the canonical totals calculator. It does not explicitly name alternatives or when to avoid it, but among siblings only get_tax_rule is vaguely related, so the usage context is mostly clear.

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.