Skip to main content
Glama

ucp_cancel_checkout

DestructiveIdempotent

Cancel a UCP checkout session. Transitions to 'canceled' status. Cannot cancel already completed checkouts. Use ONLY for a checkout session created with ucp_create_checkout (Universal Commerce Protocol); for the standard flow (create_cart, preview_checkout, complete_checkout) do not call this tool. Checkout guide: read the MCP resource trusteed://guides/checkout.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
reasonNoOptional cancellation reason
agent_keyNoSandbox credential from `create_sandbox_key`. Use this when your client cannot set an `Authorization: Bearer` header.
checkout_idYesUCP checkout session ID (valid UUID)
idempotency_keyNoREQUIRED for this write unless sent as the `Idempotency-Key` header or `params._meta["trusteed/idempotency-key"]`. 1-128 chars from [A-Za-z0-9._:/-]. Reuse the same value when retrying the same operation.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
labelNo
intentNo
statusYes
totalsYes
currencyYes
next_stepNoNext-action code, not a tool name: provide_shipping_destination, refresh_shipping_rates, choose_shipping_option, ask_user_payment_method.
created_atYes
expires_atNoISO-8601 UTC instant at which this checkout SESSION stops being usable. It is not a stock reservation and not a price guarantee.
extensionsNo`warnings[]` with `code`, `message`, `severity`.
line_itemsYes
updated_atYes
fulfillmentNo
next_actionNoOnly when a person must approve or pay: `url`, `kind`, `retry`.
approval_urlNo
idempotency_keyNo
payment_optionsNoWhen present, ask the person which option they want; never choose for them.
next_step_messageNo
expires_in_secondsNoWhole seconds left on this checkout SESSION at response time (0 when already past). It is not a stock reservation and not a price guarantee.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • changedInput schema / properties / idempotency_key / description
      Previous value: -"REQUIRED for this write unless sent as the `Idempotency-Key` header or `_meta`. Reuse the same value when retrying the same operation."New value: +"REQUIRED for this write unless sent as the `Idempotency-Key` header or `params._meta[\"trusteed/idempotency-key\"]`. 1-128 chars from [A-Za-z0-9._:/-]. Reuse the same value when retrying the same operation."
    • changedInput schema / properties / idempotency_key / maxLength
      Previous value: -255New value: +128
    • removedInput schema / properties / idempotency_key / minLength
      Removed value: -1
    • addedInput schema / properties / idempotency_key / pattern
      Added value: +"^[A-Za-z0-9._:/-]{1,128}$"
    • addedOutput schema / properties / next_step / description
      Added value: +"Next-action code, not a tool name: provide_shipping_destination, refresh_shipping_rates, choose_shipping_option, ask_user_payment_method."
  2. Changed3 schema fields changed
    • changedInput schema / properties / idempotency_key / description
      Previous value: -"Optional idempotency key to prevent duplicate cancellations."New value: +"REQUIRED for this write unless sent as the `Idempotency-Key` header or `_meta`. Reuse the same value when retrying the same operation."
    • addedInput schema / properties / idempotency_key / maxLength
      Added value: +255
    • addedInput schema / properties / idempotency_key / minLength
      Added value: +1
  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 declare destructiveHint=true and idempotentHint=true, so the safety profile is covered. The description adds real value beyond them: the resulting state ('canceled') and the precondition that already-completed checkouts cannot be canceled. It stops short of noting downstream effects (e.g., whether held inventory/payment auths are released).

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?

Four short sentences, front-loaded with the action, then the state transition, then the exclusions, then the reference link. No redundancy and every sentence carries distinct routing or behavioral information.

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 no prose. Combining the precondition, the scope exclusion, and a pointer to the checkout guide covers everything needed to call this 1-required-param mutation 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 description coverage is 100% and includes non-obvious details (idempotency-key header alternatives, agent_key fallback), so the schema does the heavy lifting. The description adds no per-parameter detail beyond the implicit checkout_id, so the 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 ('Cancel a UCP checkout session') and immediately scopes it to the UCP flow, naming the standard-flow siblings (create_cart, preview_checkout, complete_checkout) it is not for. An agent can distinguish it from ucp_complete_checkout and ucp_update_checkout without opening any schema.

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?

Explicit when-to-use ('ONLY for a checkout session created with ucp_create_checkout') plus an explicit when-not-to-use with named alternatives ('for the standard flow ... do not call this tool'). It even routes the agent to the checkout guide resource for deeper context.

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