Skip to main content
Glama
nadavgb-atom

ib-async-mcp

by nadavgb-atom

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

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

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