Skip to main content
Glama

Cancel a cart

cancel_cart
Destructive

Permanently delete a cart by cart_id. Use when the customer abandons the session or wants to start over. Has no effect on any checkout or paid order already created from this cart. Irreversible, create a new cart to restart.

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": {
      "cart_id": "<cart_id>"
    },
    "name": "cancel_cart"
  }
}

Input Schema

NameRequiredDescriptionDefault
cart_idYesId of the cart, as returned when the cart was created. Carts expire after 24 hours without changes

Output Schema

NameRequiredDescriptionDefault
cart_idYes
cancelledYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / cart_id / description
      Added value: +"Id of the cart, as returned when the cart was created. Carts expire after 24 hours without changes"
  2. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Annotations only flag destructiveHint=true; the description goes further by asserting the deletion is permanent and irreversible, that downstream checkouts and paid orders are untouched, and that recovery requires creating a new cart. That is exactly the blast-radius information an agent needs before invoking a destructive tool.

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 destructive action and key are front-loaded, and each sentence carries a distinct fact (trigger, scope limit, irreversibility). Minor redundancy between "wants to start over" and the closing "create a new cart to restart" keeps it from a 5.

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 destructive tool with full annotation coverage and an output schema, the description covers trigger, scope, side effects, and recovery. Nothing an agent needs to decide or call safely is missing.

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 sole parameter already documents its origin ("as returned when the cart was created") plus the 24-hour expiry. The description adds nothing beyond restating "by cart_id," 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?

The description opens with a specific verb+resource+key: "Permanently delete a cart by cart_id." It also pre-empts confusion with the similarly named cancel_checkout by stating it has no effect on any checkout or paid order created from the cart, so an agent can separate the two without opening either 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 positive trigger ("customer abandons the session or wants to start over") and an implicit exclusion (does not cancel checkouts/orders). It never names cancel_checkout as the alternative to use instead, so the routing guidance is clear but not fully explicit.

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