Skip to main content
Glama

update_cart

Destructive

Modify an open cart before checkout. op: 'add' appends items, 'remove' drops items by 0-based index, 'set' replaces the full item list, 'clear' empties the cart. Merges customer details (name, email, phone) via the customer field. Call get_cart afterwards to confirm. Cannot modify a cart that already has a checkout in progress.

Input Schema

NameRequiredDescriptionDefault
opNoadd appends items, remove drops the items at the given indices, set replaces the whole item list, clear empties the cart. Default set.set
itemsNoItems for add or set. Each needs product_id, width_mm, height_mm, colour and mount_type.
cart_idYescart_id returned by create_cart.
indicesNoItem indices to remove (0-based) when op='remove'
customerNoCustomer details (name, email, phone, address, city) merged into the cart.

Output Schema

NameRequiredDescriptionDefault
itemsYes
cart_idYes
currencyYes
customerYes
total_zarYes
created_atYes
expires_atYes
item_countYes
updated_atYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedInput schema / properties / cart_id / description
      Added value: +"cart_id returned by create_cart."
    • addedInput schema / properties / customer / description
      Added value: +"Customer details (name, email, phone, address, city) merged into the cart."
    • addedInput schema / properties / items / description
      Added value: +"Items for add or set. Each needs product_id, width_mm, height_mm, colour and mount_type."
    • addedInput schema / properties / op / description
      Added value: +"add appends items, remove drops the items at the given indices, set replaces the whole item list, clear empties the cart. Default set."
  2. Changed4 schema fields changed
    • addedInput schema / properties / customer / properties
      Added value: +{
      +  "address": {
      +    "type": "string"
      +  },
      +  "city": {
      +    "type": "string"
      +  },
      +  "email": {
      +    "description": "Real customer email, checked before checkout creation",
      +    "type": "string"
      +  },
      +  "name": {
      +    "description": "Real customer name, checked before checkout creation",
      +    "type": "string"
      +  },
      +  "phone": {
      +    "description": "South African phone number, checked before checkout creation",
      +    "type": "string"
      +  }
      +}
    • addedInput schema / properties / items / items
      Added value: +{
      +  "properties": {
      +    "colour": {
      +      "description": "Exact available colour; validate with configure_product before adding",
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    "finish": {
      +      "description": "Optional pricing finish for aluminium Venetians",
      +      "type": "string"
      +    },
      +    "height_mm": {
      +      "description": "Actual ordered drop in millimetres",
      +      "exclusiveMinimum": 0,
      +      "type": "number"
      +    },
      +    "mount_type": {
      +      "description": "Use inside for recess fit or outside for face fix",
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    "product_id": {
      +      "description": "product_id returned by search_catalog or lookup_catalog",
      +      "type": "string"
      +    },
      +    "product_name": {
      +      "description": "Optional; server resolves the catalogue name",
      +      "type": "string"
      +    },
      +    "quantity": {
      +      "description": "Number of blinds; defaults to 1",
      +      "type": "number"
      +    },
      +    "total_price_zar": {
      +      "description": "Optional, ignored: server recalculates all totals",
      +      "type": "number"
      +    },
      +    "unit_price_zar": {
      +      "description": "Optional, ignored: server recalculates all prices",
      +      "type": "number"
      +    },
      +    "width_mm": {
      +      "description": "Actual ordered width in millimetres",
      +      "exclusiveMinimum": 0,
      +      "type": "number"
      +    }
      +  },
      +  "required": [
      +    "product_id",
      +    "width_mm",
      +    "height_mm",
      +    "colour",
      +    "mount_type"
      +  ],
      +  "type": "object"
      +}
    • addedInput schema / properties / op / default
      Added value: +"set"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "properties": {
      +    "cart_id": {
      +      "type": "string"
      +    },
      +    "created_at": {
      +      "type": "string"
      +    },
      +    "currency": {
      +      "const": "ZAR",
      +      "type": "string"
      +    },
      +    "customer": {
      +      "anyOf": [
      +        {
      +          "additionalProperties": true,
      +          "properties": {
      +            "address": {
      +              "anyOf": [
      +                {
      +                  "type": "string"
      +                },
      +                {
      +                  "type": "null"
      +                }
      +              ]
      +            },
      +            "city": {
      +              "anyOf": [
      +                {
      +                  "type": "string"
      +                },
      +                {
      +                  "type": "null"
      +                }
      +              ]
      +            },
      +            "email": {
      +              "type": "string"
      +            },
      +            "name": {
      +              "type": "string"
      +            },
      +            "phone": {
      +              "anyOf": [
      +                {
      +                  "type": "string"
      +                },
      +                {
      +                  "type": "null"
      +                }
      +              ]
      +            }
      +          },
      +          "required": [],
      +          "type": "object"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "expires_at": {
      +      "type": "string"
      +    },
      +    "item_count": {
      +      "type": "number"
      +    },
      +    "items": {
      +      "items": {
      +        "additionalProperties": true,
      +        "properties": {
      +          "colour": {
      +            "type": "string"
      +          },
      +          "finish": {
      +            "anyOf": [
      +              {
      +                "type": "string"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ]
      +          },
      +          "height_mm": {
      +            "type": "number"
      +          },
      +          "mount_type": {
      +            "type": "string"
      +          },
      +          "product_id": {
      +            "type": "string"
      +          },
      +          "product_name": {
      +            "type": "string"
      +          },
      +          "quantity": {
      +            "type": "number"
      +          },
      +          "total_price_zar": {
      +            "type": "number"
      +          },
      +          "unit_price_zar": {
      +            "type": "number"
      +          },
      +          "width_mm": {
      +            "type": "number"
      +          }
      +        },
      +        "required": [
      +          "product_id",
      +          "width_mm",
      +          "height_mm",
      +          "quantity",
      +          "unit_price_zar",
      +          "total_price_zar"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "total_zar": {
      +      "type": "number"
      +    },
      +    "updated_at": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "cart_id",
      +    "items",
      +    "item_count",
      +    "total_zar",
      +    "currency",
      +    "customer",
      +    "created_at",
      +    "updated_at",
      +    "expires_at"
      +  ],
      +  "type": "object"
      +}
  3. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already flag readOnlyHint=false and destructiveHint=true, and the description corroborates this with 'remove drops items' and 'clear empties the cart'. Beyond the annotations it adds a genuine precondition (no edits while checkout is in progress) and merge semantics for customer data, though it does not address reversibility or error behavior.

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?

Front-loads purpose, then op modes, then the follow-up step, then the precondition. Five short sentences, each carrying distinct information with 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 destructive mutation tool with five parameters, nested item objects, full schema coverage and an output schema, the description covers what an agent needs: valid ops, the required follow-up read, and the blocking precondition. Return values and price recalculation are already documented elsewhere.

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 100%, so the baseline would be 3; the description earns an extra point by clarifying that customer details are merged rather than replaced, and by restating the op semantics and 0-based indexing of indices in a compact way. It still duplicates the enum description verbatim rather than adding new detail.

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?

States a specific verb and resource (modify an open cart) and immediately enumerates the four mutation modes with their semantics. It is clearly distinguishable from get_cart (which is named as the confirmation step) and from checkout-level siblings by the 'before checkout' scoping.

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?

Gives concrete operating guidance: call get_cart afterwards to confirm, and a hard precondition that carts with a checkout in progress cannot be modified. It does not explicitly contrast itself with update_checkout or state when to prefer 'set' over 'add'/'remove', but the usage context is otherwise clear.

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.