Skip to main content
Glama

Cancel an order

cancel_order
DestructiveIdempotent

Cancel a single order by clientId. For SHORT_TERM pass goodTilBlock; for LONG_TERM/CONDITIONAL pass goodTilTimeSeconds (the original good-til value, available from get_open_orders). Returns confirmation with the verified result (canceled / still_open / filled / pending): code: 0 only means the cancel was broadcast. If still_open, the goodTil value likely did not match the original — retry.

Input Schema

NameRequiredDescriptionDefault
marketYes
confirmNoVerify the cancel actually took via the indexer (default true).
clientIdYes
orderFlagsYes
goodTilBlockNo
goodTilTimeSecondsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / market / pattern
      Added value: +"^[A-Z0-9]{1,20}-[A-Z0-9]{1,20}$"
  2. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Annotations flag destructive/idempotent but say nothing about the asynchronous cancel model. The description supplies that: it explains the confirmation result values, warns that code 0 only means broadcast (not a confirmed cancel), and gives recovery guidance on still_open. That is exactly the behavioral context annotations cannot carry.

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 core action, then layers parameter selection, return semantics, and retry advice in tight sentences. Dense but every clause carries operative information; the nested parentheticals cost a little readability.

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?

With no output schema, the description correctly takes on return-value explanation and the failure/retry path for a destructive mutation tool. It omits any note on permissions or whether a re-cancel is safe (idempotency is only implied by annotations), leaving a small gap.

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 description coverage is only 17%, so the description must compensate, and it does for the hardest parameter interaction: which good-til field to supply based on orderFlags, and where that value comes from. market, clientId, and orderFlags receive no added semantics, so it does not fully close the coverage gap.

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 explicit scope: 'Cancel a single order by clientId.' The word 'single' cleanly separates it from the sibling tools batch_cancel and cancel_all_orders without the agent needing to open a schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives concrete decision rules for the tricky case (pass goodTilBlock for SHORT_TERM, goodTilTimeSeconds for LONG_TERM/CONDITIONAL), points to get_open_orders as the source of the good-til value, and prescribes a retry on still_open. It does not name when to prefer alternatives like batch_cancel or cancel_all_orders, so it stops short of full when/when-not routing.

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