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

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.2/5.0
Behavior2/5

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

No annotations are provided, so the description must disclose behavioral traits. It states the action but does not mention whether cancellation is reversible, what happens if the order is already cancelled, or any side effects.

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, clear sentence with no unnecessary words, making it efficient and easy to parse.

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 mutation tool with no output schema or annotations, the description is too minimal. It lacks information about success/failure indicators, idempotency, or prerequisites, which are important for correct usage.

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 schema has 100% coverage with one parameter described as 'Order ID to cancel'. The description adds no additional meaning beyond what the schema already provides.

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 clearly states the action ('cancel') and the resource ('an existing order'), distinguishing it from the sibling tool 'cancel_all_orders' which cancels all orders.

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 like 'cancel_all_orders'. While the sibling name implies a distinction, the description fails to clarify use cases or exclusions.

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