Skip to main content
Glama
aiordanescu

ib-gateway-mcp

by aiordanescu

Completed orders

get_completed_orders
Read-only

List recently filled or cancelled Interactive Brokers orders, newest first, with their completion status. Use to review what completed in current and recent sessions.

Instructions

List recently filled or cancelled orders, newest first, with IBKR's completion status.

IBKR decides how far back this reaches (the current and recent sessions). Use
get_executions for fill prices and commissions. Default limit 100, maximum 1000.
Errors: ib_api_error 321, at once, when the gateway's API is read-only (get_health:
api_read_only), which refuses this request; get_executions still lists recent fills.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of items to return. Omit for the tool's default; larger values are capped. The result's truncated flag says whether more were available.
accountNoIBKR account id, e.g. DU1234567. Omit to use the default account; list_accounts shows which accounts are allowed.
api_onlyNoOnly orders placed through the API (leave out manual TWS ones).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
totalYesHow many orders matched before the limit.
ordersYes
accountYes
truncatedNoTrue when the result was cut to the limit.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the readOnlyHint annotation, the description discloses valuable behavioral traits: newest-first ordering, IBKR-limited historical range, default/maximum limits, and the specific error (ib_api_error 321) when the gateway is in read-only mode. It also notes that get_executions still works in that scenario. These details go well beyond the annotation's simple read-only flag.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and front-loaded with the core purpose. Each sentence adds value: purpose, data-range limitation, alternative tool, and error behavior. Slight redundancy exists where the limit defaults were repeated from the schema, but the overall structure is tight and informative.

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 output schema exists and the input schema fully documents all three optional parameters, the description covers everything needed for correct selection and invocation: what the tool returns, ordering, data-range constraints, default/cap values, an explicit alternative, and a failure mode. No critical gap remains for an agent to call this tool correctly.

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

Parameters3/5

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

Schema description coverage is 100%, with each parameter (limit, account, api_only) already well described in the schema, including defaults, caps, and behavior. The description adds only minor redundancy ('Default limit 100, maximum 1000') without introducing new parameter semantics, so the baseline 3 is appropriate.

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 a specific verb+resource combination: 'List recently filled or cancelled orders, newest first, with IBKR's completion status.' This clearly identifies what the tool returns and its ordering, distinguishing it from get_executions (which reports fill prices) and get_open_orders (open orders). The scope 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 Guidelines5/5

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

The description explicitly directs agents to 'Use get_executions for fill prices and commissions,' providing a clear alternative for a related but distinct need. It also explains the data-range limitation ('IBKR decides how far back this reaches') and the read-only error scenario with get_executions as a fallback, giving concrete guidance on when to choose this tool vs its sibling.

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