Skip to main content
Glama

Change basket

update_basket
DestructiveIdempotent

Use this to change the quantity of a product in the teas.co.uk basket. quantity is the new total from 0 to 99, not an amount to add; 0 removes the line. id is the product id of the line, from view_basket or add_to_basket. If the product is not in the basket yet, a quantity above 0 adds it and 0 does nothing. An id teas.co.uk does not know, or an increase past the 20 kg parcel limit, is reported in messages and the basket stays as it was. With no basket at all it returns an error. Sending the same quantity again changes nothing. Nothing is bought or charged. To add new products use add_to_basket.

Input Schema

NameRequiredDescriptionDefault
idYesProduct id of the basket line to change (from view_basket or add_to_basket).
quantityYesThe new quantity; 0 removes it.
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

NameRequiredDescriptionDefault
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. Changed1 schema field changed
    • changedInput schema / properties / id / description
      Previous value: -"Product id of a line already in the basket (from view_basket or add_to_basket)."New value: +"Product id of the basket line to change (from view_basket or add_to_basket)."
  2. Changed1 schema field changed
    • changedInput schema / properties / id / description
      Previous value: -"Product id of a basket line."New value: +"Product id of a line already in the basket (from view_basket or add_to_basket)."
  3. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and idempotentHint=true, and the description reinforces and extends them: 0 removes the line, re-sending the same quantity is a no-op, nothing is bought or charged, and over-limit/unknown-id attempts leave the basket unchanged while reporting in messages. This is unusually rich disclosure beyond 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.

Conciseness4/5

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

Dense but front-loaded: the core action and the critical 'total not additive' distinction come first, followed by edge cases. Every sentence carries meaning, though the run of short clauses is slightly denser than ideal.

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?

An output schema exists so return values need no explanation, and the description still covers failure modes (unknown id, parcel limit, no basket, no-op), side effects (nothing bought/charged), and the id source. Complete for this mutation tool.

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 baseline is 3, but the description adds genuine semantic meaning the schema lacks: 'quantity is the new total from 0 to 99, not an amount to add; 0 removes the line' and where id comes from. It does not clarify the optional basket_id parameter, keeping it below 5.

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+resource ('change the quantity of a product in the teas.co.uk basket') and explicitly distinguishes itself from the sibling add_to_basket at the end. An agent can pick it apart from view_basket and add_to_basket without opening 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?

Gives explicit when-to-use (change quantity, add a not-yet-present product via quantity>0) and when-not-to-use ('To add new products use add_to_basket'), plus edge-case routing for unknown ids and the 20 kg limit. Nothing is left to inference.

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