Skip to main content
Glama
nadavgb-atom

ib-async-mcp

by nadavgb-atom

get_pnl

Retrieve profit and loss data for Interactive Brokers accounts to track trading performance and financial outcomes.

Instructions

Get profit and loss.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accountNoAccount ID (optional)

Implementation Reference

  • The `get_pnl` tool handler function, which calls `ib.pnl` and formats the results.
    if name == "get_pnl":
        pnl_list = ib.pnl(args.get("account", ""))
        return [{
            "account": p.account,
            "daily_pnl": p.dailyPnL,
            "unrealized_pnl": p.unrealizedPnL,
            "realized_pnl": p.realizedPnL,
        } for p in pnl_list]
  • Registration of the `get_pnl` tool in the `list_tools` function.
    Tool(
        name="get_pnl",
        description="Get profit and loss.",
        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