Skip to main content
Glama

cancel_order

Cancel an open order by ID to stop or clean up pending trades. Use with account and order ID; dry-run by default for safe verification.

Instructions

Cancel one open order by id. Talks HTTP to the local ControlServer. Default dry_run=true. Useful for operator-driven cleanup or panic stop. account is required and gated the same way as place_order: paper scope may only target paper-prefixed accounts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accountYesAccount the order belongs to. paper-prefixed names are allowed in paper scope; live scope is required for any other.
dry_runNo
order_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.10.0
    • addedInput schema / properties / account
      Added value: +{
      +  "description": "Account the order belongs to. paper-prefixed names are allowed in paper scope; live scope is required for any other.",
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "order_id"
      -]New value: +[
      +  "account",
      +  "order_id"
      +]
  2. First observedv0.6.3

TDQS

A4/5.0
Behavior3/5

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

No annotations, so the description carries the full burden. It discloses 'Default dry_run=true' and 'Talks HTTP to the local ControlServer', which adds useful behavioral context. But it never explicitly states that when dry_run=false the order is actually cancelled, nor does it mention side effects or return behavior – a significant gap for a mutation tool.

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?

Four concise sentences, each adding value. The purpose is front-loaded, followed by implementation, default, use case, and a constraint. While not as tight as a two-sentence example, there is no fluff and it reads efficiently.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/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 annotations and no output schema, it covers the essential purpose, default behavior, and account constraints. However, it does not clarify what happens when dry_run=false (presumably real cancellation) or the result/error behavior, leaving an agent uncertain about the tool's actual effect.

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 only 33% (only account is described). The description compensates by clarifying order_id as the target ('by id'), dry_run default behavior, and account gating rules. This adds meaningful semantics beyond the bare schema, though it does not fully describe each parameter's acceptable values or interactions.

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 'Cancel one open order by id' – a specific verb, resource, and scope. It clearly differentiates from siblings like cancel_all by emphasizing a single order and the 'open' status.

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?

Provides context: 'Useful for operator-driven cleanup or panic stop' and explains account gating similar to place_order. However, it does not explicitly mention alternatives like cancel_all for bulk cancellation, so it lacks explicit when-not guidance.

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