Skip to main content
Glama

Storewire Lite demo store

Add a product to a cart

cart_add_item

Adds units of one product to an anonymous Trailhead Supply cart and returns the whole cart. Without cart_token a new cart is opened and its cart_token returned. Each call adds its units again, so repeating a call raises the quantity. Only products sold online can be added, at the price a visitor pays. The answer's cart_url opens the store's website with the products in the shopper's own cart; nothing is ordered or paid here.

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": {
      "product": "<product>"
    },
    "name": "cart_add_item"
  }
}

Input Schema

NameRequiredDescriptionDefault
qtyNoUnits to add (default 1).
localeNoAnswer language: en (default en). Names, labels and URLs follow it.
productYesThe product: its public_id from an earlier answer, its page URL or slug on the store's website, or the manufacturer model number.
cart_tokenNoThe cart to add to, from an earlier cart answer; omit it to open a new cart.

Output Schema

NameRequiredDescriptionDefault
linesYes
totalNoWhat the cart costs before delivery, discounts taken off; the store's website shows the same.
limitsYes
cart_urlYesOpens the store's website with these products in the shopper's own cart, where they review and order; nothing is ordered before that.
currencyYes
subtotalYesBefore delivery and the bundle saving.
truncatedNoPresent and true only when the answer outgrew the size budget and its last list items were left out; ask narrower to see them.
cart_tokenYesPass it to the other cart tools. A secret: whoever holds it can change this cart.
expires_atYesISO 8601; every change pushes it back.
item_countYesUnits over all lines.
answer_typeNoWhat this answer is, for rendering.
vat_includedYes
delivery_hintYesHow delivery is charged, in the answer language.
discount_totalNoThe bundle saving; 0 without a whole bundle.

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?

Adds real behavior beyond the annotations: non-idempotency is spelled out ('repeating a call raises the quantity'), new-cart creation and token issuance are described, and it discloses that nothing is ordered or paid, which bounds the side effects despite readOnlyHint=false. Return shape is also flagged (whole cart, cart_token, cart_url).

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?

Front-loaded with purpose and return, then constraints. Five sentences with little waste, though the pricing remark and the 'nothing is ordered or paid' line could be tightened.

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?

An output schema exists, so return values need not be explained, yet the description still signals the key returned fields. Combined with the non-idempotency warning and new-cart behavior, an agent has everything needed to call this correctly.

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% and the schema already documents qty, locale, product forms, and cart_token omission. The description adds only marginal meaning, such as visitor pricing and online-only eligibility, rather than new detail on individual parameters, so 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?

States a specific verb and resource ('Adds units of one product to an anonymous Trailhead Supply cart'), names the return ('returns the whole cart'), and pins down the additive semantics so it is distinguishable from update/remove-style siblings.

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?

Explains the key usage fork: omit cart_token to open a new cart, supply one to add to an existing cart, and repeating a call raises quantity rather than overwriting it. It also restricts eligible products to those sold online. It stops short of explicitly routing the agent to a sibling for setting an absolute quantity.

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.