Skip to main content
Glama

create_cart

Idempotent

Build a buyer cart from chosen part IDs and quantities; returns a checkout URL, line items, and subtotal so the buyer can review and pay.

Instructions

Create a cart and get a checkout link for the buyer. Use it only after the buyer has chosen the parts and quantities. Takes one to twenty {id, quantity} items and returns checkout_url, lines and the subtotal; amounts come in dollars and, authoritatively, in cents. The buyer opens checkout_url, reviews the cart and pays there: you never pay and cannot. Refuses unknown parts, out-of-stock parts and quantities above the shelf (a part sent on several lines counts once, with the lines added up); backordered parts are accepted and flagged.

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": {
      "items": "<items>"
    },
    "name": "create_cart"
  }
}

Input Schema

NameRequiredDescriptionDefault
itemsYesOne to twenty parts with quantities.

Output Schema

NameRequiredDescriptionDefault
noteYesWhat to tell the buyer.
linesYesThe cart lines.
cart_idYesIdentifier of the cart; the same items always give the same identifier.
currencyYesCurrency of every amount.
checkout_urlYesWhere the buyer opens the cart and pays. Give this link to the buyer; never try to pay.
subtotal_usdYesSum of the line totals in US dollars, for display; shipping and tax are added at checkout.
subtotal_centsYesSum of the line totals in whole cents; authoritative.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the annotations (readOnlyHint=false, idempotentHint=true, destructiveHint=false), the description discloses the return payload, currency duality (dollars and authoritative cents), the fact that the agent cannot pay and the buyer must, and precise rejection rules for unknown, out-of-stock and over-shelf quantities, including the cross-line aggregation rule and the backorder flag. That is substantive behavioral context an agent cannot get from the annotations.

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?

Purpose is front-loaded, then precondition, then return shape, then failure/payment behavior — a sensible order with no filler sentences. The middle sentences are dense and semicolon-heavy, and the parenthetical dedup rule is easy to skim past, so it is efficient but not maximally scannable.

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 single-parameter tool with an output schema already present, the description covers everything an agent needs to call it correctly: preconditions, payload limits, currency interpretation, refusal cases, backorder handling, and who completes payment. Nothing material is left to inference.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Although schema coverage is 100%, the description adds meaning the schema does not encode: the one-to-twenty line cap is tied to a refusal rule, and 'a part sent on several lines counts once, with the lines added up' defines cross-item semantics that no single parameter description conveys. It also explains the shelf-quantity constraint that sits behind the per-line maximum.

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 description opens with a specific verb and resource ('Create a cart') and states the concrete outcome ('get a checkout link for the buyer'), which immediately distinguishes it from the read-only siblings search_products, get_product and check_availability. An agent can tell what this tool produces without opening the 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?

It gives a clear precondition: 'Use it only after the buyer has chosen the parts and quantities,' which implicitly rules out using it during browsing or discovery. It does not explicitly name the sibling tools as the alternatives for those earlier steps, so the routing guidance is clear but not fully enumerated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.