Skip to main content
Glama

binance_trade_cancelOrder

Cancel a spot trading order on Binance by specifying the symbol and order ID to manage open positions or correct errors.

Instructions

Cancel a spot order by symbol and orderId.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYes
orderIdYes

Implementation Reference

  • The tool handler implementation, which validates input, ensures trading is enabled, calls binance.cancelOrder, and returns the result or throws a tool error.
    export const tool_cancel_order: BinanceTool = {
      name: "binance_trade_cancelOrder",
      description: "Cancel a spot order by symbol and orderId.",
      parameters: cancelOrderSchema,
      async run(input) {
        ensureTradingEnabled();
        const params = cancelOrderSchema.parse(input);
        try {
          const res = await binance.cancelOrder(params.symbol, withCommonParams({ orderId: params.orderId }));
          return res.data;
        } catch (err) {
          throw toToolError(err);
        }
      }
    };
  • Zod schema for input validation: requires symbol (string) and orderId (positive integer). Used in the tool parameters and parsing.
    const cancelOrderSchema = z.object({
      symbol: z.string().min(1),
      orderId: z.number().int().positive()
    });
  • src/index.ts:15-23 (registration)
    The tool is included in the tools array, which is then iterated to register each tool with the FastMCP server via server.addTool.
    const tools = [
      tool_market_price,
      tool_market_klines,
      tool_exchange_info,
      tool_account_balances,
      tool_open_orders,
      tool_place_order,
      tool_cancel_order,
    ];
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the action ('Cancel') but lacks behavioral details: it doesn't specify if cancellation is reversible, requires authentication, has rate limits, or what happens on success/failure (e.g., order status changes). For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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 a single, efficient sentence with zero waste. It front-loads the core action ('Cancel a spot order') and specifies parameters concisely. Every word earns its place, making it easy to parse quickly.

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

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (a mutation with no annotations, 2 parameters, 0% schema coverage, and no output schema), the description is incomplete. It lacks details on behavioral traits, error handling, return values, and usage context. For a trade cancellation tool, this leaves critical gaps for an AI agent to operate effectively.

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

Parameters3/5

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

Schema description coverage is 0%, so the description must compensate. It adds meaning by naming the parameters ('symbol' and 'orderId') and implying they identify the order to cancel, which clarifies beyond the schema's basic types. However, it doesn't explain parameter formats (e.g., symbol like 'BTCUSDT') or constraints, leaving gaps. Baseline is 3 as it adds some value but doesn't fully cover the parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Cancel') and resource ('a spot order'), specifying the action and target. It distinguishes from siblings like binance_trade_placeOrder by focusing on order cancellation rather than creation. However, it doesn't explicitly differentiate from binance_account_openOrders (which might list orders) or specify it's for Binance, though the tool name implies this.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an active order), exclusions (e.g., not for margin orders), or refer to siblings like binance_account_openOrders for checking order status before cancellation. Usage is implied but not explicitly stated.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Valerio357/binance-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server