Skip to main content
Glama
trustxai

amazing-binance-mcp

by trustxai

binance_cancel_algo_order

DestructiveIdempotent

Cancel a working spot TWAP algo order to stop its execution and free an open-algo-order slot.

Instructions

Cancel a working spot TWAP algo order.

Calls DELETE /sapi/v1/algo/spot/order (SIGNED, IP weight 1). Pass exactly one id: algo_id (Binance's numeric algoId) or client_algo_id (the 32-character id you supplied when placing). Both at once is refused locally — on a destructive call an ambiguous request is worse than a refused one.

Kill-switch. Refused with Error: … trading is disabled … unless the server runs with BINANCE_ALLOW_TRADING=1.

Cancelling is idempotent in effect: a second cancel of the same algo order changes nothing and comes back as a rejection. What it cannot undo is what already traded — the sub-orders already filled stay filled, and only the unexecuted remainder is called off. Read binance_get_algo_sub_orders to see what that remainder is.

When to Use:

  • Stopping a TWAP whose thesis no longer holds, mid-execution.

  • Freeing one of the 20 open-algo-order slots.

When NOT to Use:

  • To cancel an ordinary spot order — that is binance_cancel_order (spot_orders.py); these endpoints do not see each other's orders.

  • Before checking what is open — binance_get_open_algo_orders is free of consequence and gives you the algoId this tool needs.

Returns: A confirmation echoing exactly the four fields Binance returned — algoId, success, code, msg — with no claim about how much of the order had executed. A success: false body (HTTP 200) is rendered as Error: <msg> (code <code>).

Examples: params = {"algo_id": 14511} params = {"client_algo_id": "abcdefghijklmnopqrstuvwxyz012345"}

Error Handling: A rejection usually means the algo order is not cancellable: already finished, already cancelled, or the id belongs to another account. -2015 means the key lacks Spot & Margin Trading permission or this IP is not allowlisted. A 5xx/timeout leaves the cancel UNKNOWN — re-read binance_get_open_algo_orders before assuming either way.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A5/5.0
Behavior5/5

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

Beyond the annotations, the description discloses the kill-switch requirement, idempotent effect, refusal behavior, and the fact that already-filled sub-orders cannot be undone. It also explains error semantics, including the ambiguous 5xx/timeout case and re-checking open orders. This is rich, truthful behavioral context that matches the annotations with no contradiction.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long but every section earns its place: identity, endpoint, parameter rule, kill-switch, idempotence, use cases, return shape, examples, and error handling are all separated with clear headers and bolded lead-ins. The most critical information is front-loaded, and the structure makes it easy to scan.

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 destructive nature, auth requirements, ambiguity risk, and Binance-specific error codes, this description is complete. It covers return values, examples, preconditions, failure modes, and what the tool cannot do. An agent has enough information to invoke it correctly and interpret the result in all meaningful cases.

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?

The description explains the two mutually exclusive identifiers, their relationship to the schema, the 32-character constraint on client_algo_id, and the local refusal when both are passed. It adds crucial semantic meaning beyond the schema fields, especially the 'exactly one' rule and why ambiguity is rejected on a destructive call.

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 opens with a specific verb and resource: 'Cancel a working spot TWAP algo order.' It also identifies the exact endpoint and distinguishes this from ordinary spot order cancellation by naming the alternative tool. An agent can tell exactly what this tool does and which order type it targets.

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?

There is an explicit 'When to Use' section with concrete scenarios, and a 'When NOT to Use' section that names binance_cancel_order as the alternative for ordinary spot orders. It also advises checking binance_get_open_algo_orders first. This fully routes the agent to the correct tool and preconditions.

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

Deploy Server

Other Tools