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
| Name | Required | Description | Default |
|---|---|---|---|
| account | No | Account ID (optional) |
Implementation Reference
- src/ib_async_mcp/server.py:511-518 (handler)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] - src/ib_async_mcp/server.py:136-145 (registration)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)"}, }, }, ),