Skip to main content
Glama

AgentMade Print on Demand

Cancel an order

cancel_order
DestructiveIdempotent

Cancel an order. Unpaid: closes the payment link; nothing is charged. Paid and not yet in production: cancels and refunds in full. In production or shipped: cannot be cancelled; the error gives the reason. A second call on a cancelled order is safe.

Input Schema

NameRequiredDescriptionDefault
reasonNo
order_idYesorder_id returned by purchase.

Output Schema

NameRequiredDescriptionDefault
itemsYes
totalYes
statusYes
paymentYes
order_idYesA bearer key: whoever has it can read and cancel the order. Do not share it publicly.
quote_idYes
timelineYes
next_stepYesWhat the agent should do next, in plain language.
order_urlYesThe order page. The person sees the status there.
shipmentsYes
destinationYesWhile address_needed: the quoted destination.
status_reasonYes
address_neededYesTrue when purchase had no street address: the person enters it on the order page before paying.
delivery_estimate_business_daysYesNull when the order ended (cancelled, refunded, rejected, expired or delivered).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare destructiveHint and idempotentHint, yet the description adds real substance beyond them: the financial side effects (nothing charged vs. full refund), the failure mode and that the error carries the reason, and the reinforcement that a repeat call on an already-cancelled order is safe. This is the kind of consequence-level detail an agent needs for a destructive operation.

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 core action and then ordered by the states an agent will encounter. There is no filler and every clause carries actionable 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-value documentation is unnecessary, and the description fully covers the behavioral contract: preconditions, side effects, error semantics, and idempotency. Nothing an agent needs in order to call this correctly is missing.

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

Parameters2/5

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

Schema description coverage is only 50%, and the description compensates for none of the gap: it never mentions order_id or reason. The undocumented 'reason' string (maxLength 500) is left entirely unexplained in both schema and description, so the agent must guess its purpose.

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 an order') and then enumerates the exact outcomes by order state, so an agent immediately knows what the tool does. It is unambiguously distinct from read-oriented siblings like get_order, track_order, and get_product.

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?

Provides an explicit when/when-not decision table: unpaid orders close the payment link, paid-but-not-in-production orders are cancelled and refunded, and orders in production or shipped cannot be cancelled at all. This tells the agent precisely the conditions under which calling the tool is appropriate versus futile.

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.