Skip to main content
Glama

Calculate order total

quote
Read-onlyIdempotent

Calculate the binding total for a list of items with the same code the site checkout uses (prices, minimum order, shipping rules: Nova Poshta for Ukraine; for lang en shipping and VAT by the ship_to country, minimum order 49 EUR excl. VAT). Use it after the buyer has chosen products and quantities, and before place_order, to show the exact total. Do not use it to search or to look up one product (search_products, get_product). Returns per line: qty, moq, unit and line amounts in minor units; total_minor and total_display; for lang en also goods, shipping and VAT amounts; shipping terms; min_order_ok (false means the total is below the minimum order: add items). Amounts in *_minor fields are integers in minor units (kopiyky for UAH, euro cents for EUR). Fails if the quantity is below a product minimum order quantity or a handle is not orderable (unknown_skus). Read-only: creates no order. Use the returned total_minor as expected_total_minor in place_order.

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": {
      "items": "<items>"
    },
    "name": "quote"
  }
}

Input Schema

NameRequiredDescriptionDefault
langNoSite language and market (optional, default uk). uk = Ukrainian site and ru = Russian site: Ukraine market, prices in UAH, Nova Poshta delivery, no ship_to. en = English site (site root): EU market, prices in EUR excluding VAT, delivery to EU countries, ship_to is required for quote and place_order. Use the market of the buyer; the range, prices and product handles differ between markets, so keep the same lang across search_products, get_product, quote, cart_link and place_order.uk
itemsYesOrder lines, 1 to 50, e.g. [{"handle": "ct-6205-2rs", "qty": 10}]. Each handle at most once (merge duplicates into one line).
ship_toNoDelivery destination, e.g. {"country": "DE", "postcode": "10115"}. Required when lang is en (EU market: shipping and VAT depend on the country); must be omitted for uk and ru (Ukraine: Nova Poshta, no destination country).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changed
    • addedInput schema / properties / items / description
      Added value: +"Order lines, 1 to 50, e.g. [{\"handle\": \"ct-6205-2rs\", \"qty\": 10}]. Each handle at most once (merge duplicates into one line)."
    • changedInput schema / properties / items / items / properties / handle / description
      Previous value: -"Product handle from search_products"New value: +"Product handle: the \"handle\" field of an item returned by search_products (lowercase latin letters, digits, . _ -; e.g. \"ct-6205-2rs\" for a bearing, \"diskator-deft-1-8-pruzhinnaya-stoyka\" for a machine). Required; do not invent handles, a handle that is not orderable on the chosen lang site is rejected."
    • addedInput schema / properties / items / items / properties / qty / description
      Added value: +"Quantity in pieces: integer from 1 to 9999. Must not be below the product minimum order quantity (moq from get_product)."
    • changedInput schema / properties / lang / description
      Previous value: -"Site language and market: uk (Ukrainian, default) and ru (Russian) = Ukraine, prices in UAH, Nova Poshta delivery; en (English, site root) = EU market, prices in EUR, delivery to EU countries (ship_to is required for quote and place_order)."New value: +"Site language and market (optional, default uk). uk = Ukrainian site and ru = Russian site: Ukraine market, prices in UAH, Nova Poshta delivery, no ship_to. en = English site (site root): EU market, prices in EUR excluding VAT, delivery to EU countries, ship_to is required for quote and place_order. Use the market of the buyer; the range, prices and product handles differ between markets, so keep the same lang across search_products, get_product, quote, cart_link and place_order."
    • changedInput schema / properties / ship_to / description
      Previous value: -"Delivery destination. Required when lang is en (EU market: shipping and VAT depend on the country); must be omitted for uk and ru (Ukraine: Nova Poshta)."New value: +"Delivery destination, e.g. {\"country\": \"DE\", \"postcode\": \"10115\"}. Required when lang is en (EU market: shipping and VAT depend on the country); must be omitted for uk and ru (Ukraine: Nova Poshta, no destination country)."
    • changedInput schema / properties / ship_to / properties / country / description
      Previous value: -"Delivery country, ISO 3166-1 alpha-2 (DE, PL, FR…)"New value: +"Delivery country, ISO 3166-1 alpha-2, two uppercase letters (DE, PL, FR…). Shipping cost and VAT are calculated for this country."
    • addedInput schema / properties / ship_to / properties / postcode / description
      Added value: +"Postal code of the delivery address, up to 16 characters, e.g. \"10115\". Optional; if omitted, the country alone is used."
  2. First observed

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint/idempotent/non-destructive, yet the description still adds real behavior: the checkout runs the same pricing code, failure conditions (quantity below moq, non-orderable handle -> unknown_skus), and the min_order_ok flag; 'Read-only: creates no order' is a minor restatement of the annotation.

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 purpose and flow position; return-shape details are unusually complete because there is no output schema. Slightly redundant around the minor-unit explanation, and the long single block would be easier to scan if split into return-format and failure sections.

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 no output schema, the description carries the full return contract: per-line qty/moq/unit/line amounts, totals, shipping terms, min_order_ok, and how to consume total_minor downstream. Nothing an agent needs to call it and interpret the result is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, but the description adds market semantics it cannot infer from the schema: uk/ru are Ukraine with Nova Poshta and no ship_to, en is the EU market with VAT and ship_to required, and market choice changes handles/prices. It also explains *_minor units (kopiyky, euro cents) rather than leaving the unit implicit.

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?

Specific verb and resource — 'Calculate the binding total for a list of items' — with an explicit scope claim that the code is the same as the site checkout. It immediately distinguishes itself from search_products and get_product in the same paragraph.

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?

Gives explicit placement in the flow ('after the buyer has chosen products and quantities, and before place_order') and explicit exclusions naming the alternatives (search_products, get_product) for search/lookup. It also states the downstream handoff ('use total_minor as expected_total_minor in place_order').

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