Skip to main content
Glama

update_cart_item

Set the quantity of a cart line by variant ID, capped at available stock. Use it to adjust item counts in an existing Kaimoru cart before checkout.

Instructions

Set the quantity of one line in one of your carts, addressed by variant_id. The cart service caps the quantity at the stock on hand. Use remove_cart_item to remove a line.

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>",
      "variant_id": "<variant_id>",
      "quantity": "<quantity>"
    },
    "name": "update_cart_item"
  }
}

Input Schema

NameRequiredDescriptionDefault
cart_idYesThe cart handle, from `create_cart`.
quantityYesThe line's new quantity (at least 1; stock-capped by the cart service).
variant_idYesThe line's variant id.

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

A4/5.0
Behavior3/5

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

No annotations are provided, so the description carries full behavioral burden. It discloses that the cart service caps quantity at stock on hand, which is useful mutation behavior, but it omits permissions, error behavior when the variant is not already in the cart, and whether repeats are idempotent.

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?

Two short sentences with no wasted wording. The core action and stock-cap constraint are front-loaded, followed by the removal alternative.

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?

An output schema exists, so return values need not be explained. For a three-required-parameter mutation, the description covers the key stock-cap behavior and removal alternative, though it could say more about failure cases or prerequisites.

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 the schema already explains cart_id, variant_id, and quantity. The description adds only that the line is addressed by variant_id and that quantity is stock-capped, which largely repeats the schema-provided meaning.

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 description states a specific verb and resource: 'Set the quantity of one line in one of your carts, addressed by variant_id.' It also distinguishes the operation from line removal by naming remove_cart_item, so the agent can tell it apart from sibling mutation tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly routes removal to remove_cart_item, giving a clear alternative for that case. It does not mention add_cart_item for adding a new line, but the usage context is clear enough for invocation.

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