Skip to main content
Glama

Set a quantity

set_quantity
Idempotent

Set a product's cart quantity to a desired final amount, use 0 to remove it, then read the cart back for French grocery shopping.

Instructions

Sets a product's quantity in the cart (replaces the current one; 0 removes the product), then reads the cart back.

Input Schema

NameRequiredDescriptionDefault
storeYesretailer (see list_stores)
quantityYesdesired final quantity
product_idYesretailer product identifier (id field of search_products)

Output Schema

NameRequiredDescriptionDefault
lineYes
storeYes
confirmedYestrue if the cart read back holds the targeted quantity
product_idYes
cart_total_eurYes
expected_quantityYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

Beyond the annotations (which only declare mutation, idempotency and open-world access), the description discloses that the current value is overwritten, that quantity 0 deletes the line item, and that the cart is read back afterward. That is meaningful side-effect context the schema does not convey.

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 with parenthetical detail and no filler. Every clause carries information an agent needs.

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?

With an output schema and full parameter descriptions, the description only needs to convey mutation semantics and side effects, which it does. It is complete for the call, though it omits the quantity upper bound (50) and the fact that store is constrained to a single retailer value.

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, and the description earns an extra point by explaining the special value 0 for quantity, which the schema only implies via minimum: 0 and 'desired final quantity'. Nothing is added for product_id or store, but they are already well documented.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Sets a product's quantity in the cart') and adds the key distinction that it replaces rather than increments. It implicitly separates itself from add_to_cart/remove_from_cart through the replace and 0-removes semantics, but never names those siblings explicitly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The replace semantics and '0 removes the product' hint at when this is preferable to add_to_cart or remove_from_cart, but the description never states the alternative or the condition that selects it. An agent must infer the routing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.