Skip to main content
Glama

Change a quantity

set_quantity

Sets the quantity of a cart line; 0 removes it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
quantityYes
cart_tokenYescart_token from create_cart
product_idYes
combination_idNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.7/5.0
Behavior4/5

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

With annotations present, the description earns credit for disclosing what the annotations hide: setting quantity to 0 deletes the cart line, which is exactly the 'what gets destroyed' context the destructiveHint=false flag does not convey. The mild tension with destructiveHint=false is defensible since a cart line item is not irreversible data destruction, and the description errs toward more disclosure, not less.

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 clause-pair sentence with zero waste, front-loading the core action and appending the most important edge case. Nothing is padded or repeated from the schema.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with no output schema and four parameters at 25% schema coverage, this is thin: the agent still doesn't know how variant/combination selection works, whether quantity is capped, or what the call returns. The removal semantics are covered, but other gaps remain.

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 description coverage is only 25% (just cart_token), so the schema leaves three parameters bare. The description adds real meaning for quantity by explaining that 0 is a removal sentinel, but it says nothing about combination_id (variant selection) or the quantity maximum of 10. It compensates partially, not fully.

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?

The description names a specific verb (sets) and resource (quantity of a cart line), plus a useful edge-case behavior (0 removes the line). It doesn't differentiate from the siblings add_line, remove_line, or create_cart, which matters because set_quantity(0) overlaps with remove_line.

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?

Usage is only implied: 'subtract-by-setting-0' is hinted at, but there's no explicit guidance on when to use this versus add_line or remove_line, nor prerequisites such as needing a cart_token from create_cart. Adequate but leaves the agent to infer the routing.

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