Skip to main content
Glama

add_cart_item

Add product units to an existing cart using cart ID, product ID, and quantity; include variant ID for combination products. Stock is revalidated, and the updated cart is returned.

Instructions

Add units of a product to one of your carts. Pass variant_id when the product has combinations (see get_product). Stock is re-validated on every call; the answer is the cart read back after the add.

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": {
      "cart_id": "<cart_id>",
      "product_id": "<product_id>",
      "quantity": "<quantity>"
    },
    "name": "add_cart_item"
  }
}

Input Schema

NameRequiredDescriptionDefault
cart_idYesThe cart handle, from `create_cart`.
quantityYesUnits to add (1 to 999999).
product_idYesThe product id, from a search or list result.
variant_idNoThe combination to add; required when the product has combinations, omitted for a plain product.

Output Schema

NameRequiredDescriptionDefault
linesYesThe cart's lines, in cart order.
cart_idYesThe cart handle.
total_yenYesGrand total in yen: subtotal plus shipping.
item_countYesTotal units across all lines.
shipping_yenYesShipping fee in yen (free at the store's threshold).
subtotal_yenYesSum of purchasable line totals, in yen.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description carries the full disclosure burden and does add two useful traits: stock is re-validated on every call (so the call can fail for availability reasons) and the response is the cart read back after the add. It still omits failure handling for insufficient stock, the cumulative nature of repeated calls, and any permission or ownership requirements.

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?

Three short sentences, front-loaded with the action, then the variant caveat, then the behavioral note. No filler; only the slightly informal closing clause about the answer being the cart read back could be tightened.

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?

Parameter coverage is complete and an output schema exists, so return values need no explanation. For a mutation tool with zero annotations, however, the description should say more about side effects, stock-failure behavior, and how repeated calls accumulate quantity before an agent can invoke it with confidence.

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 coverage is 100%, so all four parameters, including the conditional variant_id rule and the quantity range, are already documented in the schema. The description's variant_id sentence largely restates the schema and only adds the tip to consult get_product, so baseline 3 is appropriate.

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?

States a specific verb and resource: "Add units of a product to one of your carts." The additive verb distinguishes it in spirit from update_cart_item and remove_cart_item, but the description never explicitly contrasts incrementing quantity versus setting it, which is the main ambiguity an agent faces among these siblings.

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?

Offers one real conditional: pass variant_id when the product has combinations, with a pointer to get_product for discovery. Otherwise there is no guidance on when to choose this over update_cart_item, no preconditions about cart state, and no note on behavior when stock runs out.

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