Skip to main content
Glama
walmart-ca-mcp
by anaqi

Set quantity in Walmart.ca cart

set_cart_quantity
DestructiveIdempotent

Set the exact quantity of an item already in the signed-in cart, with 0 removing it. Use add_to_cart for items not yet in the cart.

Instructions

Set an item already in the signed-in cart to an exact quantity (0 removes it). Use add_to_cart for items not yet in the cart. Returns the new line total and cart subtotal.

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": {
      "product": "<product>",
      "quantity": "<quantity>"
    },
    "name": "set_cart_quantity"
  }
}

Input Schema

NameRequiredDescriptionDefault
productYesProduct id (as in get_cart) or walmart.ca product URL
quantityYesNew quantity, 0-12

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, idempotentHint=true and openWorldHint=true, so the safety profile is covered. The description still adds real value on top: it discloses that quantity 0 deletes the line and that the call returns the new line total and cart subtotal, which is the only source of return-value information since there is no output schema. It does not mention the 0-12 cap or any failure modes, but the schema covers the range.

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?

Three short sentences, front-loaded with the core action and scope, then the alternative, then the return contract. No filler and nothing buried.

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 no output schema and full schema coverage, everything an agent needs is present: precondition, alternative tool, the destructive 0 case, and the return values. Nothing material is missing.

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 meaning the schema does not: the schema only says 'New quantity, 0-12', whereas the description explains that 0 removes the item. That is a genuinely non-obvious semantic for the quantity parameter, though the 'product' parameter gets no added explanation beyond the schema.

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?

Names a specific verb and resource ('Set an item already in the signed-in cart to an exact quantity') plus the scope constraint that the item must already be in the cart. It explicitly differentiates itself from the sibling add_to_cart, so an agent can pick the right tool without opening either 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?

States the precondition (item already in the signed-in cart) and names the alternative for the opposite case ('Use add_to_cart for items not yet in the cart'). It also folds the removal case in via '(0 removes it)', so the agent knows it does not need a separate delete call.

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