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"],
        },
    ),
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It fails to specify the state change (e.g., order status changes to 'cancelled'), reversibility, error conditions (e.g., attempting to cancel a filled order), or side effects. 'Cancel' implies mutation but lacks crucial specifics.

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 three-word sentence is appropriately front-loaded with no extraneous information. While extremely brief given the lack of annotations and behavioral details, it contains no structural waste or filler.

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?

For a destructive financial operation with no output schema or annotations, the description is dangerously incomplete. It omits critical trading-domain context such as 'only cancellable while order is open' and 'cannot cancel filled orders', which are essential for correct agent invocation.

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?

The input schema has 100% description coverage for its single parameter ('Order ID to cancel'). The description adds no supplementary context about the parameter (e.g., source, format constraints), meeting the baseline expectation when the schema is fully self-documenting.

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 uses a specific verb ('Cancel') and resource ('order'), clearly stating the tool's function. However, it misses the opportunity to explicitly distinguish from the sibling tool 'cancel_all_orders' by clarifying this operates on a single order.

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 'cancel_all_orders', nor does it mention prerequisites such as the order needing to be in an open/pending state (critical for trading contexts). It merely restates the tool's action.

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

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