MCP server that connects to Interactive Brokers TWS via ib_insync and exposes trading tools for use with Claude
Server has 11 tools with mostly complete schemas and descriptions. Naming follows verb_noun convention (ib_*). Descriptions are present and substantive (avg ~120 chars). Input schemas use Pydantic models with type constraints and enums. However, output schemas are not documented, LLMs cannot predict response structure. Error handling is minimal; no recovery guidance. Two-step order flow (prepare/submit) is well-designed for safety but lacks explicit confirmation prompts in tool descriptions. Missing tool annotations (readOnlyHint, destructiveHint) despite clear risk levels. Parameter descriptions are good but some lack format/range details (e.g., expiry format YYYYMMDD stated but not enforced in schema).
Get account summary information (cash, positions value, buying power, etc.)
Cancel an active order
Check connection status to TWS
Get execution history
Get historical OHLC data for a security
Get real-time market data snapshot for a security
Get list of open orders
Get status of a specific order
Output schemas not documented. LLMs cannot predict response structure for any tool. Responses must include account values, position details, order confirmations, etc., but no schema is visible in code or docstrings.
Tool annotations missing. Despite clear risk levels (READ_ONLY, WRITE, IRREVERSIBLE), no readOnlyHint, destructiveHint, or idempotentHint attributes are present. LLMs cannot infer safety properties.
Error handling lacks recovery guidance. No error messages visible in code that tell LLM what to do next (retry, ask user, abort). Connection failures, invalid orders, and TWS disconnects will return raw exceptions.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | D | 59 | 2026-07-28+ | v2 |
Get current open positions
Prepare an order for review (step 1 of 2-step order flow). Returns order details and a confirmation token for later submission.
Submit a previously prepared order (step 2 of 2-step order flow). Requires the confirmation token from ib_prepare_order.
ib_submit_order confirmation token validation is weak. Token is 12 chars (SHA256 truncated) but no expiry check visible in code. Tokens stored in _pending_orders dict with TTL, but no validation that token matches the order being submitted.
Parameter format constraints not enforced in schema. Expiry (YYYYMMDD), bar_size, duration, and what_to_show accept free-form strings. No regex patterns or enums in Pydantic models. LLMs will hallucinate invalid values.