Skip to main content
Glama
aiordanescu

ib-gateway-mcp

by aiordanescu

Portfolio

get_portfolio
Read-only

List an account's positions with market price, value, and unrealized/realized P&L. Uses IBKR valuation without a market-data subscription; data refreshes every three minutes.

Instructions

List an account's positions with market price, market value and unrealized/realized P&L.

Values are in each position's currency and use IBKR's own valuation (no market-data subscription needed); IBKR refreshes them about every 3 minutes. For an account other than the default the call takes a moment longer, because IBKR streams portfolio data for one account at a time.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accountNoIBKR account id, e.g. DU1234567. Omit to use the default account; list_accounts shows which accounts are allowed.

Output Schema

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

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior5/5

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

With readOnlyHint and openWorldHint provided by annotations, the description adds substantial extra behavioral context: values use IBKR's own valuation, require no market-data subscription, refresh about every 3 minutes, and a non-default account causes extra latency because IBKR streams one account at a time. These are meaningful operational traits an agent needs to set expectations, going well beyond the annotation flags.

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?

Three sentences, each earning its place: the first defines the output, the second explains valuation and refresh behavior, the third warns about latency. Core purpose is front-loaded)Skip, and there is no filler or repetition of schema content.

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?

Despite being a simple tool with one optional parameter, the description covers what is returned, the valuation source, refresh cadence, and performance trade-offs. Since an output schema exists, return fields need no explanation. The one caveat about non-default accounts is exactly the kind of operational detail that helps an agent decide when to call it. Nothing essential is missing.

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?

The input schema fully documents the single optional 'account' parameter with a description including an example ID and instructions to omit it for the default account. Since schema coverage is 100%, the description need not repeat parameter details. The latency note for non-default accounts is behavior, not parameter semantics, so the 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 'List an account's positions with market price, market value and unrealized/realized P&L', stating a specific verb and resource. It clearly differentiates from siblings like get_positions (positions without valuation) and get_pnl (P&L summary without positions) by combining both. The wording is specific enough for an agent to select it without guessing.

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

Usage Guidelines3/5

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

The description implies when to use it by enumerating the returned data (positions + market value + P&L), but it never explicitly contrasts it with get_positions, get_pnl, or get_position_pnl, nor does it state conditions when an alternative would be better. The only usage note, about non-default accounts taking longer, is a performance caveat, not a routing guideline. This is adequate but leaves selection partially to inference.

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