Skip to main content
Glama
zionto

ibkr-mcp

by zionto

flex_run_query

Execute an Interactive Brokers Flex query and retrieve the complete XML report in a single call, combining request and polling steps.

Instructions

Send a Flex query and wait for the complete XML report.

Combines flex_send_request + flex_get_statement in one call.

Args: query_id: Flex Query ID (overrides IBKR_FLEX_QUERY_ID env var). 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
query_idNo
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. It discloses the polling behavior ('poll_interval_seconds', 'max_wait_seconds'), the wait-for-completion semantics, and the return format ('Returns JSON: {"xml_content": ...}'). It also mentions environment variable overrides for credentials. This provides substantial transparency beyond the schema, though it lacks details on error handling or side effects.

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, with a one-line purpose, a note on composition, a structured list of arguments, and a return-type line. Every sentence earns its place; no filler or redundant information. The structure is clean and front-loaded.

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?

Given the tool's moderate complexity (4 parameters, composite workflow, no annotations), the description is fairly complete: it covers what the tool does, how it works (polling), parameters, and return format. It could be improved by noting that the output is raw XML and that parsing tools exist for further analysis, but for its core function it is sufficient.

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

Parameters4/5

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

Schema coverage is 0%, so the description must fully explain the parameters. It does so effectively: each parameter is listed with its purpose and default behavior (e.g., 'query_id: Flex Query ID (overrides IBKR_FLEX_QUERY_ID env var)'). This adds meaning beyond the schema, which only provides types and defaults. The parameter explanations are clear and concise.

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 clear action: 'Send a Flex query and wait for the complete XML report.' It explicitly names the composite nature by stating 'Combines flex_send_request + flex_get_statement in one call,' which distinguishes it from its sibling tools. This gives a specific verb and resource, and differentiates it effectively.

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 clearly indicates this tool is a combination of two sibling tools, implying it should be used when a single call is preferred over sequential calls. However, it does not explicitly state when not to use it or provide direct exclusions for alternatives. The usage context is clear but not exhaustive.

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