Skip to main content
Glama

Cancel an order

cancel_order
DestructiveIdempotent

Cancel an order, stopping it before it is printed. With the order_token from create_order this works while the order is awaiting_payment (which also closes its payment link, and a payment that still lands on it is refunded in full automatically), and after payment until production starts (order.refund_on_cancel is true), when the payment is refunded in full automatically and the result status is refunded. A platform that sends its own API key (Authorization: Bearer mp_live_...) can additionally cancel an order THAT KEY created while it is confirmed or printing — that is how you stop a press when your customer cancels on your side. shipped and delivered can never be canceled; that is a refund, contact support (see get_catalog). Once printing has started, canceling (creating key only) stops production but moves no money. Canceling releases the order's client_reference — replaying that reference afterwards creates a new order and prints it. If the order moved on before the cancel landed you get not_cancellable naming its new status, never a false "canceled".

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": {
      "order_id": "<order_id>"
    },
    "name": "cancel_order"
  }
}

Input Schema

NameRequiredDescriptionDefault
order_idYesThe order_id returned by create_order, e.g. ord_01HZX8K3M9QWER5T7Y2B4N6C8D. Not the order_token.
order_tokenNoThe token returned once by create_order. Optional if you send the API key that created the order instead.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / order_id / description
      Added value: +"The order_id returned by create_order, e.g. ord_01HZX8K3M9QWER5T7Y2B4N6C8D. Not the order_token."
  2. Changed2 schema fields changed
    • addedInput schema / properties / order_token / description
      Added value: +"The token returned once by create_order. Optional if you send the API key that created the order instead."
    • changedInput schema / required
      Previous value: -[
      -  "order_id",
      -  "order_token"
      -]New value: +[
      +  "order_id"
      +]
  3. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only say destructive/idempotent/non-readOnly; the description adds the money semantics (full automatic refund, refunded status), the side effect of closing the payment link, that a late payment is auto-refunded, that printing stops but no money moves for create-key cancels, and that the client_reference is released so replay creates a new order. It also documents the failure mode (not_cancellable naming the new status) so the agent is never misled by a false success.

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 the core action and the key constraints, and nearly every clause carries non-obvious information an agent needs. It is dense to the point of strain, however: long em-dash-chained sentences and nested parentheticals (payment-link closure and auto-refund inline) cost readability for a small gain.

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?

With no output schema, the description carries the burden of return behavior and does so: success results in status refunded, and failure returns not_cancellable with the order's new status. Combined with the auth-scoping note and the permanent-not-cancellable exclusions, an agent has everything needed to call this correctly or route elsewhere.

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 already explains both parameters, including 'Not the order_token' and that order_token is optional when sending the creating API key. The description's mentions of order_token and the creating-key path largely restate that, adding little new syntactic or semantic detail, 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?

Opens with a specific verb and resource plus the operative boundary: 'Cancel an order, stopping it before it is printed.' It also draws the crucial line between canceling and refunding (shipped/delivered 'can never be canceled; that is a refund'), so an agent can distinguish this from siblings like create_order or get_order 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?

Gives explicit when-it-works conditions (awaiting_payment; after payment until production starts when order.refund_on_cancel is true), an additional create-key-only window for confirmed/printing orders, and explicit exclusions (shipped/delivered, with 'contact support / see get_catalog' as the redirect). This is a full when/when-not/alternative map.

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