Skip to main content
Glama
nadavgb-atom

ib-async-mcp

by nadavgb-atom

get_positions

Retrieve all trading positions from Interactive Brokers accounts to monitor holdings and track portfolio performance.

Instructions

Get all positions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accountNoAccount ID (optional)

Implementation Reference

  • Handler for the 'get_positions' tool, which fetches all positions for an account using the IB API.
    if name == "get_positions":
        positions = ib.positions(args.get("account", ""))
        return [{
            "account": p.account,
            "symbol": p.contract.symbol,
            "sec_type": p.contract.secType,
            "position": p.position,
            "avg_cost": p.avgCost,
        } for p in positions]
  • MCP Tool registration for 'get_positions'.
        name="get_positions",
        description="Get all positions.",
        inputSchema={
            "type": "object",
            "properties": {
                "account": {"type": "string", "description": "Account ID (optional)"},
            },
        },
    ),

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