Skip to main content
Glama
aiordanescu

ib-gateway-mcp

by aiordanescu

Positions

get_positions
Read-only

Retrieve an account's current positions: contract, signed quantity, and average cost including commissions. Uses IBKR-streamed data for up-to-date results.

Instructions

List an account's positions: contract, quantity (negative = short) and average cost.

Fast and always current (IBKR streams position changes). avg_cost includes
commissions and, for options and futures, the multiplier. For market value and
unrealized P&L use get_portfolio; for today's P&L of one position use
get_position_pnl. `contract.exchange` is not reported for positions; use the con_id
for follow-up calls. `model_code` (financial advisors) lists one model's positions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accountNoIBKR account id, e.g. DU1234567. Omit to use the default account; list_accounts shows which accounts are allowed.
model_codeNoFinancial-advisor model code, to scope the result to one model portfolio. Omit for the whole account (normal for non-advisor accounts).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
as_ofYesWhen this server read the values (UTC).
accountYes
positionsYes
model_codeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the readOnlyHint and openWorldHint annotations, the description reveals non-obvious behavioral traits: positions are streamed and always current, avg_cost includes commissions and multiplier, and contract.exchange is omitted, directing follow-up via con_id. These are valuable details not derivable from the schema or annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Five sentences with zero waste. The core purpose is front-loaded, followed by fast/current behavior, cost details, sibling routing, a caveat about exchange, and the model_code nuance. Every sentence contributes distinct information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description fully equips an agent to select and invoke the tool: it states the resource, outputs, alternatives, an important data caveat, and parameter scoping. An output schema exists, so return-value documentation is not required, and no missing piece undermines a correct call.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, and both parameters are fully documented in the schema. The description adds a brief note about model_code meaning 'lists one model's positions', but this largely mirrors the schema's existing explanation. With the schema carrying the parameter burden, a baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource: 'List an account's positions', and enumerates the key returned fields (contract, quantity, average cost). It further differentiates from siblings by naming get_portfolio and get_position_pnl for related but distinct data, making its purpose unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit routing guidance is provided: 'For market value and unrealized P&L use get_portfolio; for today's P&L of one position use get_position_pnl.' It also clarifies when model_code is appropriate, clearly stating the alternative behavior for financial-advisor accounts.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.