Skip to main content
Glama

Acme Store

Change a cart line

update_cart_item
Idempotent

Set how many units of a variant a cart holds. Use it to buy several of one thing, or to take a line out with quantity 0. Returns the whole cart, or an error when there is not that much stock or no open cart.

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": "update_cart_item"
  }
}

Input Schema

NameRequiredDescriptionDefault
cart_idNothe cart.id that add_to_cart returned; leave out in a browser, which sends its own cart cookie
quantityYesthe new number of units; 0 removes the line
variant_idYesthe variant to change

Output Schema

NameRequiredDescriptionDefault
cartNo
errorNoUpstream's error string ("Error adding item to cart", ...); absent on success.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

The annotations already declare readOnlyHint=false, destructiveHint=false, idempotentHint=true and openWorldHint=false, so the safety profile is covered. The description adds genuine behavioral context beyond that: it discloses the failure modes ('an error when there is not that much stock or no open cart') and that the whole cart is returned, which tells an agent how to handle the response.

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 usage, then return/error behavior. Nothing is padded and no sentence merely restates the title 'Change a cart line'.

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 full schema coverage, an output schema and complete annotations, the description covers the operation, the 0-quantity edge case and the error conditions, which is nearly everything an agent needs. The remaining details (the maximum of 50, cart_id omission in browsers) live in the schema, so the gap is minor.

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 description coverage is 100%, so all three parameters are already documented, including the '0 removes the line' semantics and the browser cookie note for cart_id. The description's only added value is restating that a quantity of 0 removes the line, which the schema already says; baseline 3 applies.

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 gives a specific verb and resource ('Set how many units of a variant a cart holds'), which is precisely the absolute-set operation that distinguishes it from the sibling add_to_cart's incremental add. An agent can pick this tool over add_to_cart without opening either schema.

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?

'Use it to buy several of one thing, or to take a line out with quantity 0' supplies concrete usage contexts and the key edge case. It stops short of naming an alternative or stating when not to use it (e.g. 'use add_to_cart to increase an existing line by an increment'), so it is clear but not routing-complete.

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