Skip to main content
Glama
pedrobraiti

mcp-ibkr-agent

by pedrobraiti

wait_for_fill

Poll an order until filled, cancelled, rejected, or inactive, or timeout. Returns status with timed_out flag if not complete.

Instructions

Poll an order until it reaches a terminal state (filled/cancelled/rejected/inactive), or the timeout elapses.

Closes the confirm-the-fill loop so the agent doesn't have to orchestrate the retry itself. Returns the latest status with timed_out true if it was still working when time ran out. timeout_seconds is capped at 120. Note: an inactive result usually means the order was rejected/killed, but IBKR also uses it for an order parked until the market opens — so confirm intent before assuming it's dead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
order_idYes
timeout_secondsNo
Behavior4/5

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

With no annotations, the description carries full burden. It discloses polling behavior, terminal states, timeout cap (120 seconds), return value (timed_out flag), and nuance about 'inactive' status meaning different things. It does not mention rate limits or error handling but is transparent about core behavior.

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 with no waste. Front-loaded main action, then usage guidance, then important nuance. Every sentence adds value.

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 no output schema, description adequately explains return values (latest status with timed_out flag). It covers key edge cases (inactive state ambiguity). Could mention error handling or effect on the order, but overall complete for a polling tool.

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 description must compensate. It explains both parameters: order_id (the order to poll) and timeout_seconds (max wait, capped at 120). This adds meaning beyond the schema, which only provides names and defaults.

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 clearly states it polls an order until a terminal state (filled/cancelled/rejected/inactive) or timeout. It explicitly mentions the resource (order) and action (wait/poll), and distinguishes from sibling tools like order_status by framing this as the 'confirm-the-fill loop' that automatically retries.

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 explains the tool's purpose and when to use it (to wait for order completion without manual orchestration). It gives context about the inactivity nuance, but does not explicitly contrast with alternatives like order_status or specify when not to use it.

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/pedrobraiti/agentic-trading-mcp'

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