Skip to main content
Glama

Update cart

update_cart
Destructive

Changes a cart drawer: texts, sections and their order, reward tiers (free shipping, discounts, free gifts), product upsells, order upsells, trust badges, payment icons and look. Send only what changes, named as get_cart returns it. Without an id it changes the live cart. A cart that is off saves at once. The live cart goes in two steps: the first call saves nothing and returns a picture of the change, the list of changes and a confirm_token. Show the merchant, and when they say yes, call again with the same id and confirm_token (you can omit changes, or resend the same changes). Reward tiers change what checkout charges: confirm a new or changed threshold, discount or free gift with the merchant before sending it, and afterwards tell them what the result's rewards.tell_merchant says. Custom HTML blocks stay in the app. When matching a screenshot or another store's cart, ask the merchant first whether to copy its colors or keep the store's own colors, then render_cart_preview the result and patch what differs. For an A/B test, version B, C or D changes that version while the test is a draft, and saves at once.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "update_cart"
  }
}

Input Schema

NameRequiredDescriptionDefault
idNoCart id from list_carts. Default: the live cart, or the store's only cart.
changesNoFields to change, named as get_cart returns them. Sections merge into what is there; a section the cart lacks starts from its defaults, so send enabled: true to show it. Write shopper text in the cart's language (get_cart shows it).
versionNoA/B test version. Default A, the live item. B, C and D change only while the test is a draft.
confirm_tokenNoFor the live cart: the token from the preview, once the merchant said yes. When passed, changes may be omitted.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / id / description
      Previous value: -"Cart id from list_carts. Default: the live cart."New value: +"Cart id from list_carts. Default: the live cart, or the store's only cart."
  2. Changed2 schema fields changed
    • changedInput schema / properties / changes / properties / products_upsell / description
      Previous value: -"Products to add from the cart: auto_recommend (Shopify's related or complementary picks) or manual (rules that pick products). Fields: enabled, upsell_type, auto_recommendation_intent, auto_recommendation_limit, hide_added_products, layout, title, subtitle, button_text, title_color, subtitle_color, button_bg_color, button_text_color, product_title_color, product_subtitle_color, price_color, compare_at_price_color, card_border_color, card_bg_color, bg_color, image_size, text_size. get_cart with include_style shows their values."New value: +"Products to add from the cart: auto_recommend (Shopify's related or complementary picks) or manual (rules that pick products; fallback_to_auto_recommend: true shows AI recommendations when no rule matches). Fields: enabled, upsell_type, fallback_to_auto_recommend, auto_recommendation_intent, auto_recommendation_limit, hide_added_products, layout, title, subtitle, button_text, title_color, subtitle_color, button_bg_color, button_text_color, product_title_color, product_subtitle_color, price_color, compare_at_price_color, card_border_color, card_bg_color, bg_color, image_size, text_size. get_cart with include_style shows their values."
    • addedInput schema / properties / changes / properties / products_upsell / properties / fallback_to_auto_recommend
      Added value: +{
      +  "description": "In manual mode, show Shopify auto recommendations when no rule matches.",
      +  "type": "boolean"
      +}
  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 destructiveHint=true, idempotentHint=false and openWorldHint=true, but the description adds much more: an off cart saves immediately while the live cart saves nothing on the first call and returns a preview plus confirm_token, and the second call must resend the id and token. It also discloses the downstream effect that reward tiers change checkout charges and must be merchant-confirmed, which is behavior an agent cannot get from the annotations.

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?

It is front-loaded and nearly every sentence carries a rule or a constraint, but it is a dense block that mixes routing, save semantics, merchant-confirmation policy and screenshot-matching workflow without visual separation. A reader gets the essentials first, though the middle section on screenshots and reward tiers is harder to scan.

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 4-parameter tool with deeply nested objects, no output schema, and destructive/open-world annotations, the description supplies the missing decision layer: save timing, preview/confirm protocol, merchant-confirmation requirements, and the A/B draft restriction. An agent has enough to call it correctly without guessing at the mutation's consequences.

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 would be 3, but the description adds real semantics: 'changes' is a sparse patch named as get_cart returns it, id defaults to the live cart, confirm_token is the approval token from the preview and permits omitting changes, and version B/C/D is restricted to drafts. These workflow meanings go beyond the per-property schema text.

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?

The opening sentence names a specific verb (changes) and enumerates the exact resources it touches: texts, section order, reward tiers, upsells, trust badges, payment icons and look. It distinguishes the tool from get_cart ('named as get_cart returns it') and render_cart_preview, so an agent can tell which tool to pick without opening a 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?

Explicit guidance is given for the tricky cases: omit changes that are unchanged, omit id to target the live cart, use the two-step preview/confirm flow for the live cart but not for an off cart, confirm reward-tier changes with the merchant before sending, and only use version B/C/D while the test is a draft. It also states a hard exclusion: custom HTML blocks stay in the app.

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