Skip to main content
Glama

Update cart

update_cart
DestructiveIdempotent

Sets the quantity of existing cart lines by line_id; quantity 0 removes a line. Returns the updated cart and checkout_url. No order is placed and no payment is taken here; checkout_url opens the checkout on shop.nevini.wine. line_id comes from create_cart, add_to_cart or get_cart; use add_to_cart for wines that are not in the cart yet.

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>",
      "lines": "<lines>"
    },
    "name": "update_cart"
  }
}

Input Schema

NameRequiredDescriptionDefault
linesYes
cart_idYescart_id exactly as returned by create_cart, including its ?key= part.
languageNoLanguage of item names and of the checkout: "nl" (default) or "en".

Output Schema

NameRequiredDescriptionDefault
itemsYes
cart_idYes
currencyYes
warningsYes
next_stepYes
checkout_urlYes
order_placedYes
subtotal_eurYes
shipping_noteYes
total_quantityYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • removedOutput schema / properties / age_notice
      Removed value: -{
      -  "type": "string"
      -}
    • changedOutput schema / required
      Previous value: -[
      -  "cart_id",
      -  "order_placed",
      -  "currency",
      -  "items",
      -  "total_quantity",
      -  "subtotal_eur",
      -  "checkout_url",
      -  "next_step",
      -  "age_notice",
      -  "shipping_note",
      -  "warnings"
      -]New value: +[
      +  "cart_id",
      +  "order_placed",
      +  "currency",
      +  "items",
      +  "total_quantity",
      +  "subtotal_eur",
      +  "checkout_url",
      +  "next_step",
      +  "shipping_note",
      +  "warnings"
      +]
  2. First observed

TDQS

A4.7/5.0
Behavior4/5

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

Substantively elaborates the destructiveHint annotation by explaining exactly what gets destroyed (a line at quantity 0) and what is returned (updated cart plus checkout_url) and where that URL leads (shop.nevini.wine). It stops short of covering authorization needs, per-cart line limits, or failure modes, so it's strong but not exhaustive.

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 tight sentences, ordered from core action to side effects to ID provenance. No restatement of the title and no filler.

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 3-parameter mutation tool with an output schema and annotations, the description covers the mutation semantics, the removal case, the lineage of line_id, and the non-payment guarantee. Nothing an agent needs in order to call it correctly is missing.

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 67%, and the description compensates on the most error-prone parameter by explaining that line_id refers to an existing line and enumerating the tools that produce it. It says nothing about the language parameter or quantity bounds, leaving those to the schema where they are already documented.

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?

Names a specific verb and resource (set quantity of existing cart lines by line_id) and states the edge behavior (quantity 0 removes a line). It also explicitly carves out the sibling boundary: 'use add_to_cart for wines that are not in the cart yet.'

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?

Gives the precondition (line_id must come from create_cart, add_to_cart or get_cart) and the exclusion rule routing new items to add_to_cart. It also sets expectations that no order is placed and no payment is taken, which frames when this tool is and isn't the final step.

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