Skip to main content
Glama

Add to basket

add_to_basket

Use this when someone asks to add teas.co.uk products to their basket. It adds to what is already there: a product already in the basket goes up by the quantity given. items takes up to 20 products, each an id from find_products with a quantity of 1 to 99. An id teas.co.uk does not know fails the whole call with an error naming it, and nothing is added; a product that cannot be added (out of stock, or over the 20 kg parcel limit) is listed in messages while the rest are added. Returns the basket with the live subtotal and a delivery estimate. Nothing is bought or charged. Leave basket_id out on hosts that identify the customer; otherwise pass the basket_id from the first basket result to every later basket tool. Not for changing or removing a line (use update_basket); to buy chosen products straight away use checkout_session.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsYesProducts and quantities to add.
basket_idNoOnly for hosts that do not identify the user: the basket_id returned by an earlier basket tool in this conversation. Leave it out otherwise.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
addedNoHow many products were added.
itemsYesNumber of items in the basket.
linesYes
deliveryYes
messagesYesAnything that could not be added or changed, in plain words.
subtotalNoPounds including VAT, before delivery.
basket_idNoPresent only when the host did not identify the user: pass it to later basket tools.
subtotal_textYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only declare the safety profile (readOnly=false, destructive=false, idempotent=false, openWorld=false); the description goes well beyond by disclosing additive accumulation, atomic failure on an unknown id ('fails the whole call ... nothing is added'), partial-success semantics for out-of-stock/over-limit items reported via messages, and that nothing is bought or charged. IdempotentHint=false is consistent with the stated additive behavior, so there is no contradiction.

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-loads the trigger and the core additive/failure semantics before the routing alternatives, and every sentence carries operational weight. It is dense but slightly long; the basket_id propagation sentence, while valuable, could be tightened.

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?

For a two-parameter mutation tool with an output schema, the definition covers trigger, additive behavior, error and partial-failure handling, charge safety, basket_id lifecycle, and sibling routing. Return values (subtotal, delivery estimate) are summarized even though the output schema exists. Nothing an agent needs to call it correctly is absent.

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 adds real meaning the schema cannot express: the conditional rule for basket_id (omit on customer-identifying hosts, otherwise propagate the id from the first basket result to every later basket tool). The items limits (20 products, id from find_products, quantity 1-99) restate the schema rather than extend it.

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 ('add teas.co.uk products to their basket') and immediately distinguishes itself from siblings by naming update_basket and checkout_session as the tools for adjacent intents. An agent can route without inspecting any 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?

Explicit when-to-use trigger ('when someone asks to add ... to their basket'), explicit additive semantics, and explicit exclusions with named alternatives ('Not for changing or removing a line (use update_basket)', 'to buy chosen products straight away use checkout_session'). Both the use case and the counter-cases are covered.

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