Skip to main content
Glama

cancel_order

Destructive

Cancel a resting order by its order ID to remove a stale or mistaken entry on the real account. Use get_orders to find the ID; orders cannot be modified in place.

Instructions

LIVE MONEY: acts on the real account. Cancel one resting order by its order id. order_id comes from get_orders; pass coin with it (asset, the numeric index, only when coin is unknown). Cancelling a position's only stop leaves it unprotected: to move a stop use set_stop, and to clear leftover orders on a flat coin use sweep_brackets. Orders cannot be modified in place: to change a resting entry, cancel it here and place a new one with place_bracket. Use for a stale entry or a mistaken order. Needs a trading key. Returns {ok}; an order already filled or cancelled, or a missing coin and asset, returns the venue's {error} with isError true.

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
coinNoThe order's coin, as in get_orders (BTC or xyz:GOLD).
assetNoNumeric asset index, only when coin is unknown.
order_idYesThe order id (oid) from get_orders.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.6.1
    • changedInput schema / properties / asset / description
      Previous value: -"index, if no coin"New value: +"Numeric asset index, only when coin is unknown."
    • changedInput schema / properties / coin / description
      Previous value: -"e.g. xyz:BRENTOIL"New value: +"The order's coin, as in get_orders (BTC or xyz:GOLD)."
    • addedInput schema / properties / order_id / description
      Added value: +"The order id (oid) from get_orders."
  2. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations only supply destructiveHint=true, so the description carries real weight and delivers: LIVE MONEY real-account warning, trading-key requirement, the risk that cancelling a position's only stop leaves it unprotected, and error behavior ({error} with isError true for already-filled/cancelled or missing coin+asset). The return value {ok} is also disclosed. It stops short of stating rate limits or whether cancellation is reversible/retryable, keeping it from a 5.

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-loads the critical LIVE MONEY warning and packs many actionable facts into a short block; each sentence carries information. Slightly dense with multiple clauses per sentence, but there is no filler.

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?

No output schema exists, yet the description explains the success payload ({ok}) and failure shape (venue {error}, isError true), plus auth and risk context. For a 3-parameter mutation tool this is nearly complete; only retry/idempotency semantics are unstated.

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 documents that order_id is the oid from get_orders, that coin is the order's coin, and that asset is only used when coin is unknown. The description mostly restates this ('order_id comes from get_orders; pass coin with it (asset, the numeric index, only when coin is unknown)'), adding only mild emphasis on passing coin alongside. Baseline 3 applies since the schema does the work.

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 with scope: "Cancel one resting order by its order id." It also implicitly distinguishes itself from modification tools by noting orders cannot be modified in place, so an agent can tell cancel from set_stop/place_bracket without opening other schemas.

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 use cases (stale entry, mistaken order) and routes to named alternatives with conditions: set_stop to move a stop, sweep_brackets to clear leftovers on a flat coin, place_bracket to re-place a changed entry. When-to-use and when-to-use-something-else are both covered.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.