Skip to main content
Glama

Set cart item

cart_set_item
DestructiveIdempotent

Set the exact cart line quantity and wholesale selection. This overwrites the quantity and wholesale setting for the same itemId/configurationId; it does not add to the quantity. Omitting wholesale uses standard pricing. Appends a new line when that itemId/configurationId is not already in the cart. For a supplier preview, first call catalog_get_product and wait for full product details; use only a configuration and buyer offer actually returned there. Current pricing and availability are re-quoted. Returns the updated cart view. Requires cart:write scope. Use cart_remove_item to remove a line.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemIdYesSuperCheap product ID from full catalog_get_product details. Open supplier previews with catalog_get_product and wait for complete variants and buyer offers before adding.
quantityYesExact line quantity. Replaces current quantity for this itemId/configurationId (not additive).
wholesaleNoEnable wholesale pricing for this line.
countryCodeYesISO 3166-1 alpha-2 market country code. Choose from market_list output.
currencyCodeYesISO 4217 alpha-3 market currency code. Choose from market_list output.
languageCodeYesLowercase ISO 639-1 language code. Choose from market_list output.
configurationIdNoVariant or option selection ID as returned by catalog_get_product. Omit for products without configurations.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / itemId / description
      Previous value: -"Canonical SuperCheap product ID from catalog search or product details."New value: +"SuperCheap product ID from full catalog_get_product details. Open supplier previews with catalog_get_product and wait for complete variants and buyer offers before adding."
  2. Changed7 schema fields changed
    • addedInput schema / properties / configurationId / description
      Added value: +"Variant or option selection ID as returned by catalog_get_product. Omit for products without configurations."
    • addedInput schema / properties / countryCode / description
      Added value: +"ISO 3166-1 alpha-2 market country code. Choose from market_list output."
    • addedInput schema / properties / currencyCode / description
      Added value: +"ISO 4217 alpha-3 market currency code. Choose from market_list output."
    • addedInput schema / properties / itemId / description
      Added value: +"Canonical SuperCheap product ID from catalog search or product details."
    • addedInput schema / properties / languageCode / description
      Added value: +"Lowercase ISO 639-1 language code. Choose from market_list output."
    • addedInput schema / properties / quantity / description
      Added value: +"Exact line quantity. Replaces current quantity for this itemId/configurationId (not additive)."
    • addedInput schema / properties / wholesale / description
      Added value: +"Enable wholesale pricing for this line."
  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 this a non-read-only, destructive, idempotent write, and the description adds substantive context beyond them: the overwrite (not additive) semantics for the same itemId/configurationId, the append-when-absent behavior, standard pricing when wholesale is omitted, re-quoting of pricing/availability, the required cart:write scope, and that the updated cart view is returned. No behavioral gap is left for a mutation tool of this kind.

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?

The core action and overwrite semantics are front-loaded, followed by prerequisites, side effects and the sibling redirect. It is fairly long at seven sentences but each one carries a distinct fact; no sentence is redundant.

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 7-parameter mutation with no output schema, the definition covers everything needed: identity key semantics, overwrite vs append, auth scope (cart:write), prerequisite tool call, pricing re-quote side effect, and confirmation that the updated cart view is returned. Nothing an agent needs in order to call it correctly 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 description coverage is 100%, so the baseline is 3, but the description adds real meaning the schema does not: the composite itemId/configurationId identity that determines overwrite vs append, and the default pricing behavior when wholesale is absent. It stops short of explaining return-value shape or the interaction among the three market codes.

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 (set cart line quantity and wholesale selection) and pins down the exact identity key (itemId/configurationId). It explicitly distinguishes itself from siblings by naming cart_remove_item and by clarifying it overwrites rather than adds, so an agent can tell it apart from cart_get, cart_clear and cart_remove_item 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 and when-not-to-use: call catalog_get_product first for supplier previews and use only configurations/buyer offers actually returned, use cart_remove_item to remove a line, and it names the condition under which a new line is appended. Alternatives and prerequisites are both spelled out.

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