Skip to main content
Glama

cancel_order

Destructive

Cancel one resting live-money order by its order ID from get_orders to remove a stale or mistaken order before it fills; include coin or asset if unknown.

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. 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.8/5.0
Behavior5/5

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

Beyond destructiveHint=true, the description discloses that this acts on the real account with live money, requires a trading key, and that cancelling a sole stop leaves a position unprotected. It also documents failure behavior: filled/cancelled orders or a missing coin and asset return the venue's {error} with isError true.

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 highest-stakes fact (live money) and packed into a single dense paragraph with no filler sentences. It is information-rich but slightly crowded, with guidance, parameter sourcing, and error semantics interleaved.

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 3-parameter mutation tool with no output schema, the description covers the safety profile, auth requirement, parameter sourcing, alternatives, and the return shape ({ok} vs {error} with isError). 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.

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds provenance and pairing rules not in the schema: order_id comes from get_orders, coin should be passed alongside it, and asset is a fallback only when coin is unknown. This clarifies how the parameters relate rather than just restating them.

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 explicitly distinguishes itself from set_stop and sweep_brackets, so an agent can select it 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-to-use ("a stale entry or a mistaken order") and when-not guidance with named alternatives: set_stop to move a stop, sweep_brackets to clear leftover orders on a flat coin. It also flags the consequence of cancelling a position's only stop.

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