get_open_trades
Retrieve all currently active trades from Interactive Brokers accounts to monitor positions and track ongoing market activity.
Instructions
Get all open trades.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/ib_async_mcp/server.py:670-681 (handler)The implementation of the get_open_trades tool handler, which retrieves open trades using `ib.openTrades()` and serializes them for the response.
if name == "get_open_trades": trades = ib.openTrades() return [{ "order_id": t.order.orderId, "symbol": t.contract.symbol, "action": t.order.action, "quantity": t.order.totalQuantity, "order_type": t.order.orderType, "status": t.orderStatus.status, "filled": t.orderStatus.filled, "remaining": t.orderStatus.remaining, } for t in trades] - src/ib_async_mcp/server.py:293-297 (registration)The tool 'get_open_trades' is registered in the list of available tools.
Tool( name="get_open_trades", description="Get all open trades.", inputSchema={"type": "object", "properties": {}}, ),