Skip to main content
Glama
staskh

trading-skills

by staskh

ib_portfolio

Retrieve current portfolio positions from Interactive Brokers, including stocks and options with market prices. Requires TWS or IB Gateway running locally.

Instructions

Get portfolio positions from Interactive Brokers.

Returns all positions including stocks and options with market prices. Requires TWS or IB Gateway running locally.

Args: port: IB port (7496 for live, 7497 for paper) account: Specific account ID (optional, uses first if not specified)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
portNo
accountNo
Behavior4/5

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

Without annotations, the description discloses a key prerequisite (TWS/IB Gateway running locally) and explains the account selection behavior ('uses first if not specified'). It also states the return includes market prices, giving insight into output. No contradiction with annotations exists since none are provided.

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?

The description is compact and front-loaded with the tool's purpose, followed by a short return summary, a prerequisite, and an Args section. Every sentence provides useful information without redundancy.

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

Completeness4/5

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

The description covers the tool's purpose, return content, prerequisite, and parameters, but since there is no output schema, it does not detail the exact return shape or error conditions. For a read-only position-getter, this is adequate but not exhaustive.

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

Parameters5/5

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

The description adds meaning beyond the schema by explaining the port values ('7496 for live, 7497 for paper') and the optionality/behavior of the account parameter. This compensates for the 0% schema description coverage.

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 uses the specific verb 'Get' with resource 'portfolio positions' from Interactive Brokers, and clarifies it returns all positions with stocks/options and market prices. This clearly differentiates from siblings like ib_portfolio_action_report, which concerns action reports.

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

Usage Guidelines4/5

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

The description provides a clear context: it returns portfolio positions and requires TWS or IB Gateway running locally. It does not explicitly mention alternatives, but the description of the tool is sufficient to infer when to use it. The optional account parameter is also clarified.

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

Install Server

Other Tools

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/staskh/trading_skills'

If you have feedback or need assistance with the MCP directory API, please join our Discord server