Skip to main content
Glama

Bafan

Set cart quantity

set_cart_quantity
DestructiveIdempotent

Set the quantity of one confirmed variant in the cart. Zero removes it. Returns the changed items and 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": {
      "variant_id": "<variant_id>",
      "quantity": "<quantity>"
    },
    "name": "set_cart_quantity"
  }
}

Input Schema

NameRequiredDescriptionDefault
cart_keyNoGuest carts only; omit it when the account is connected. Private tool input. Copy the key from an earlier tool result, the cart_key query parameter of a payment link, or the last segment of a /shop/mcp-checkout/ link already in the chat. Keep it out of shopper replies.
quantityYes
variant_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare this as non-read-only, destructive, and idempotent; the description adds concrete value on top by explaining exactly what the destructive case is (quantity 0 removes the line) and by disclosing the return shape (changed items and subtotal) despite there being no output schema. It does not cover failure modes such as an out-of-stock or non-confirmed variant, so it is not exhaustive.

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 operation, then the edge case, then the return value. No redundant restatement of the tool name or title, and nothing could be removed without losing information.

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?

For a 3-parameter mutation with annotation coverage and no output schema, the description supplies purpose, the key destructive edge case, and the return shape — enough to call it correctly. It omits what happens on invalid input (variant not in cart, quantity above the 100 cap), which would be the remaining gap.

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?

With only 33% schema coverage (only cart_key is documented), the description compensates by clarifying that quantity=0 is a deletion rather than a valid zero-quantity line, and that variant_id must refer to a confirmed, already-present variant. cart_key handling is left entirely to the schema, so the description does not fully close the coverage gap.

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?

"Set the quantity of one confirmed variant in the cart" names a specific verb (set), resource (cart line/variant) and scope (one confirmed variant), which separates it from cart-creation or cart-read siblings. It does not name an explicit alternative, but the operation is unambiguous.

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 implied rather than stated: "one confirmed variant in the cart" signals the variant must already exist in the cart, and "Zero removes it" tells the agent how to delete a line. There is no explicit when-to-use versus when-not statement and no pointer to get_cart/checkout_cart for other cart operations.

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