Skip to main content
Glama

Check a cart before checkout

check_cart_before_checkout
Read-only

Checks a cart at checkout. Takes the checkout session exactly as a commerce protocol returns it (a UCP checkout or an ACP CheckoutSession) or plain line items, plus what the customer already owns. Returns a decision per line item, safe_to_checkout, an action (proceed, resolve_conditions, do_not_checkout, ask_customer), questions, substitutions, a signed receipt, and a com.tetheredtrust.shopping.compatibility extension object to attach to the checkout.

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": "check_cart_before_checkout"
  }
}

Input Schema

NameRequiredDescriptionDefault
ownedNoWhat the customer already owns that these items must work with (model numbers, URLs or descriptions; objects may carry config like memory_modules).
checkoutNoThe checkout session as your commerce protocol returns it: a UCP checkout (line_items[].item.title) or an ACP CheckoutSession (line_items[].item.id). Or send line_items directly.
productsNoACP only: map of item id → {title | url | gtin} from your product feed, because ACP line items carry only ids.
line_itemsNoGeneric cart: [{id, title | url | gtin | sku | text, quantity, price_usd}]. Used when checkout isn't sent.
cart_total_usdNoOptional cart total in US dollars. Carts of $500 or more get a high_value notice to confirm with the manufacturer first.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -{
      -  "type": "object"
      -}New value: +null
  2. Changed2 schema fields changed
    • addedInput schema / properties / cart_total_usd
      Added value: +{
      +  "description": "Optional cart total in US dollars. Carts of $500 or more get a high_value notice to confirm with the manufacturer first.",
      +  "type": "number"
      +}
    • changedInput schema / properties / line_items / description
      Previous value: -"Generic cart: [{id, title | url | gtin | sku | text, quantity}]. Used when checkout isn't sent."New value: +"Generic cart: [{id, title | url | gtin | sku | text, quantity, price_usd}]. Used when checkout isn't sent."
  3. First observed

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, openWorldHint=true, and idempotentHint=false, so the safety profile is covered. The description adds meaningful behavioral context beyond annotations by listing the decision-per-line-item return, safe_to_checkout, action values, questions, substitutions, signed receipt, and an extension object to attach to checkout. It does not explain auth, rate limits, or action semantics in depth, so it is 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.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with purpose and then covers inputs and outputs in a compact three-sentence form. The return-value sentence is dense with many enumerated outputs, but each item is relevant given there is no output schema. It is efficient overall, though the long return list reduces readability slightly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

This is a complex tool with five optional parameters, nested objects, open-world behavior, and no output schema. The description supplies the missing return-shape information and clarifies accepted checkout formats, which is sufficient for an agent to call it correctly. It could be slightly more complete about input combinations or how products and line_items interact, but the schema covers those details.

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 description coverage is 100%, so the schema already documents all five optional parameters in detail. The description reinforces that checkout may be a UCP checkout, an ACP CheckoutSession, or plain line_items, and that owned items are supplied, but it mostly summarizes existing schema descriptions rather than adding new syntax or relationship details. Baseline 3 is appropriate when the schema carries parameter semantics.

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: "Checks a cart at checkout." It makes clear this is a pre-checkout cart check that returns per-line decisions and a compatibility extension. It does not explicitly distinguish itself from siblings such as check_compatibility or validate_purchase_plan, so it is clear but not sibling-differentiating.

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?

The description implies usage before checkout and explains accepted input forms: a UCP checkout, an ACP CheckoutSession, or plain line items plus owned items. However, it gives no explicit when-to-use/when-not-to-use guidance and does not name alternatives such as check_compatibility or validate_purchase_plan. Context is present but guidance versus alternatives is only implied.

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