Skip to main content
Glama

Cancel order (order to cash)

o2c_cancel_order
Destructive

Cancel an order that has not shipped. Once anything has shipped the order cannot be cancelled — bill it and issue a credit instead. Cancellation is not a way to make a mistake disappear; the order stays visible as cancelled. Effects: order.status -> cancelled; committed value released.

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>",
      "reason": "<reason>"
    },
    "name": "o2c_cancel_order"
  }
}

Input Schema

NameRequiredDescriptionDefault
reasonYesWhy it was cancelled. Kept as pattern memory.
order_idYesThe order. An existing order id.

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 destructive=true and idempotent=false; the description adds real value beyond them by naming the precondition (unshipped only), the downstream state change (order.status -> cancelled, committed value released), and the persistence caveat that the cancelled order stays visible. That is the kind of consequence detail annotations cannot express.

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 lines, front-loaded with the precondition, then the alternative path, then the effects. No filler, and the key constraint comes first.

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?

Covers preconditions, failure path, and state effects, which is nearly everything an agent needs for a two-parameter mutation with no output schema. It does not say what the call returns (e.g. the cancelled order object) or what happens on an invalid order_id, leaving a small gap.

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 both parameters are documented there (order_id 'An existing order id', reason 'Kept as pattern memory'). The description adds no syntax or constraint info beyond the schema, 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?

States a specific verb and resource ('Cancel an order') plus the gating condition ('that has not shipped'), which cleanly separates it from siblings like o2c_amend_order, o2c_close_short, and o2c_create_credit_note. An agent can pick this tool from the description alone.

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?

Explicitly gives the negative case — once anything has shipped, cancel is off the table and the agent must 'bill it and issue a credit instead', routing to o2c_invoice_shipped/o2c_create_credit_note. It also warns against using cancellation as a fix-up mechanism.

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.