Skip to main content
Glama

Mango Inventory

Cancel order

cancel_order
Destructive

Cancel (withdraw) an order. Only the requester can cancel their OWN order, and only while it is still open; once fulfillment has started the requester cannot cancel it; an order manager can still decline it (reject_order). Releases any reserved stock. Irreversible: a closed order cannot be reopened.

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

Input Schema

NameRequiredDescriptionDefault
orderIdYesOrder id (from list_orders)

Output Schema

NameRequiredDescriptionDefault
statusNoopen | in_fulfillment | fulfilled | rejected | cancelled
webUrlNoLink to this order in the web app, for a person to open; `orderId` is the handle for tool calls. Absent when the deployment has no public address
orderIdNoOrder id
closedAtNoClose time, epoch milliseconds
targetNameNoWho/where the order delivers to
closedAtIsoNoThe same moment as an ISO-8601 UTC timestamp — read THIS one; the server does no timezone conversion

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / orderId / description
      Previous value: -"Order id (find with list_orders)"New value: +"Order id (from list_orders)"
    • changedOutput schema / properties / webUrl / description
      Previous value: -"Link to this order in the web app — give your user THIS, never the raw `orderId` (that is a machine handle for your next call). Absent when the deployment has no public address"New value: +"Link to this order in the web app, for a person to open; `orderId` is the handle for tool calls. Absent when the deployment has no public address"
  2. First observed

TDQS

A4.7/5.0
Behavior5/5

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

The annotations already declare this as destructive, non-idempotent, and not read-only, but the description adds critical behavioral context beyond them: ownership restriction, open-state requirement, stock release, and irreversibility. It clarifies that closing an order cannot be undone and that fulfillment changes who can act.

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?

The description is front-loaded with the core action and then layers permissions, state constraints, side effects, and irreversibility without wasted wording. The semicolon-separated clauses are dense but purposeful.

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 destructive, state-dependent cancellation tool with an output schema, the description covers who can cancel, when cancellation is allowed, what side effect occurs, and what alternative exists. Nothing material is missing for correct invocation.

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?

There is one parameter, orderId, and schema coverage is 100%, including a note that the id comes from list_orders. The description adds no further parameter meaning beyond the schema, so the baseline 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 states a specific verb and resource: cancel/withdraw an order. It also clarifies the scope by distinguishing requester cancellation from manager rejection via reject_order. An agent can identify the operation without opening the 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?

It gives explicit when-to-use and when-not-to-use rules: only the requester may cancel their own order, only while it is still open, and not after fulfillment has started. It also names the alternative route for managers: reject_order.

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