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
| Name | Required | Description | Default |
|---|---|---|---|
| token | No | ||
| query_id | No | ||
| max_wait_seconds | No | ||
| poll_interval_seconds | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |