Skip to main content
Glama

X402-Broker Universal MCP Gateway & Multi-Agent Swarm Router

update_cart

Idempotent

Update line item quantities in an active shopping cart. Example: update_cart(cart_id='cart_1', line_items=[])

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
cart_idNoShopping cart identifier.
line_itemsNoUpdated cart line items.

Output Schema

NameRequiredDescriptionDefault
storeYesMerchant domain identifier.
ucp_versionNoSupported UCP specification version.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare that the operation is not read-only, is idempotent, and is non-destructive, so the description need not carry the full safety burden. It adds the useful constraint that the cart must be active, but it does not clarify whether line_items replaces the whole set or only updates quantities, nor what happens to omitted items.

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 description is short and front-loads the action and resource. The example is compact but slightly misleading because line_items=[] does not demonstrate the quantity fields being updated.

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?

An output schema exists and annotations cover the safety profile, reducing what the description must explain. Still, for a mutation tool, it leaves important gaps around whether line_items is a full replacement or a partial update and how individual line items should be shaped.

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 both parameters are already documented in the schema, and the baseline is 3. The description adds the idea that line_items concerns quantities, which is mildly useful, but the example with an empty array does not illustrate the expected line-item object structure.

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?

The description states a specific verb and resource: updating line item quantities in an active shopping cart. It is distinguishable from read/create/cancel cart siblings, though it does not explicitly contrast with update_checkout.

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?

Usage is implied by 'active shopping cart' and 'line item quantities', giving a reasonable context for when to call it. However, there are no explicit when-not conditions or guidance versus alternatives such as update_checkout or get_cart.

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.