Skip to main content
Glama
roman-zaglauer

OctoBot MCP Server

cancel_order

Cancel a specific open order on your OctoBot-connected exchange by providing its order ID. Resolves issues when you need to remove an unwanted or erroneous order.

Instructions

Cancel one order by id.

Maps to POST /api/orders?action=cancel_order -- action is a query parameter, not a JSON body field (confirmed against source, the same pattern octobot_mcp.tools.tentacles.update_tentacle_config already documents for its own route). The JSON body is the raw order_id value itself, NOT wrapped in an object: confirmed against source (Services/Interfaces/web_interface/api/trading.py::orders() does interfaces_util.cancel_orders([flask.request.get_json()]), and cancel_orders(order_ids) -- packages/services/octobot_services/ interfaces/util/order.py -- iterates its argument directly as a list of order ids). Use the id field from get_orders()'s own response items for this value.

Success: OctoBot returns HTTP 200 with the literal JSON string "Order cancelled", returned unchanged (NFR-8). Failure -- the order wasn't found on any connected exchange, including the case where every exchange manager tried raised an internal cancel error OctoBot itself silently swallows rather than propagating (see this module's docstring) -- raises OrderCancelRejectedError with OctoBot's own extracted error text (always, in practice, the literal "Impossible to cancel order: order not found.").

Not confirm-gated: the user was explicitly asked about the spec's own footnote flagging this tool as "revisitable" given its irreversible effect, and chose to keep it ungated (milestone 13.6), per ADR-0003's original reasoning that this is routine, expected trading-bot activity. No confirm parameter exists on this tool at all.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
order_idYes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations provided, the description carries full behavioral disclosure and does so thoroughly: exact HTTP success behavior, literal success string, failure mode including OctoBot's swallowed internal errors, the raised exception, and the irreversibility/confirm-gating rationale. This goes far beyond a generic 'cancels an order' statement.

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?

The description is front-loaded with the core purpose and then organized into clear route/body, success/failure, and confirmation-gating sections. It is somewhat verbose with source-code citations and internal references, but most of that detail directly supports correct invocation and behavioral expectations.

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?

Given the single parameter, no annotations, and no output schema, this description is exceptionally complete. It covers parameter construction, HTTP details, success and failure behavior, exception types, and the absence of a confirm parameter, leaving little ambiguity for an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

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

Schema coverage is 0%, so the description must fully explain the parameter, and it does. It clarifies that order_id is sent as the raw JSON body rather than wrapped in an object, that action is a query parameter, and that the value should come from get_orders() responses.

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 opening sentence 'Cancel one order by id' names a specific verb, a specific resource (one order), and the identifying input. It is clearly distinguishable from sibling tools like cancel_job, close_position, and clear_orders_history.

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?

The description explains how to obtain the correct value ('Use the id field from get_orders()'s own response items'), which is key usage guidance. It does not explicitly contrast this tool with sibling alternatives or state when not to use it, but the context is strong and the invocation path is unambiguous.

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