Skip to main content
Glama
nadavgb-atom

ib-async-mcp

by nadavgb-atom

cancel_order

Cancel an existing Interactive Brokers order by specifying its order ID to manage trades and account positions.

Instructions

Cancel an existing order.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
order_idYesOrder ID to cancel

Implementation Reference

  • The handler logic for the 'cancel_order' tool, which iterates through active IB orders and cancels the matching order ID.
    if name == "cancel_order":
        orders = ib.orders()
        for order in orders:
            if order.orderId == args["order_id"]:
                ib.cancelOrder(order)
                return {"status": "cancel_requested", "order_id": args["order_id"]}
        return {"error": "Order not found"}
  • The schema registration for 'cancel_order', defining the required 'order_id' input parameter.
    Tool(
        name="cancel_order",
        description="Cancel an existing order.",
        inputSchema={
            "type": "object",
            "properties": {
                "order_id": {"type": "integer", "description": "Order ID to cancel"},
            },
            "required": ["order_id"],
        },
    ),

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/nadavgb-atom/ib-async-mcp'

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