Skip to main content
Glama
zionto

ibkr-mcp

by zionto

flex_get_statement

Retrieves a completed Flex report from Interactive Brokers using its reference code, automatically polling until ready, and returns the XML content.

Instructions

Download a completed Flex report using its reference code.

Polls automatically until the report is ready or the timeout is reached.

Args: reference_code: Reference code returned by flex_send_request. token: Flex API token (overrides IBKR_FLEX_TOKEN env var). poll_interval_seconds: Seconds between polling attempts (default 5). max_wait_seconds: Maximum seconds to wait for the report (default 120).

Returns JSON: {"xml_content": "<FlexQueryResponse...>..."}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tokenNo
reference_codeYes
max_wait_secondsNo
poll_interval_secondsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It discloses polling behavior, timeout limits, and the return format. It also notes that token overrides an environment variable. It doesn't cover error handling or rate limits, but the key behaviors are clearly stated.

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 efficient and well-organized: a one-line purpose, a one-line explanation of polling, a structured Args list, and a Returns line. Every sentence earns its place without redundancy.

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?

Given the polling complexity and four parameters, the description covers what the tool does, how it behaves, what parameters mean, and what it returns. The presence of an output schema is not strictly needed since the Returns line explicitly shows the JSON shape.

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 significant meaning to all four parameters: it explains that reference_code comes from flex_send_request, token overrides an env var, and provides defaults for polling/timeout. This goes well beyond the bare schema, which has no descriptions.

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 starts with a specific verb and resource: 'Download a completed Flex report using its reference code.' This clearly distinguishes it from siblings like flex_send_request (which creates a request) and flex_parse_* (which parse data). The purpose is unambiguous.

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 implies the workflow by stating the reference code comes from flex_send_request, making it clear this tool is used after a request is submitted. It doesn't explicitly name alternatives or exclusions, but the context is strong enough for correct selection among siblings.

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/zionto/ibkr-mcp'

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