Skip to main content
Glama
aiordanescu

ib-gateway-mcp

by aiordanescu

Stream tick-by-tick data

subscribe_tick_by_tick
Read-only

Start recording real-time trades, bid/ask changes, or midpoints for a contract into a buffer you can page through later. Select Last, AllLast, BidAsk, or MidPoint tick types for market data capture.

Instructions

Start recording every trade, quote change or midpoint of one contract into a ring buffer.

get_subscription_data returns the buffered ticks oldest first (use its `since` and
`limit` to page). Times are when the tick reached this server (UTC). IBKR allows
only about 3 tick-by-tick streams at a time; this server refuses more. One stream
per contract and tick_type: subscribing again returns the same handle. Needs live
data and a market data subscription for the instrument (not available with delayed
data); errors 10189 and 10190 mean IBKR refused it or its limit is reached. Stop it
with unsubscribe.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contractYesThe instrument. A con_id alone is unambiguous; otherwise give symbol and sec_type, plus expiry, strike and right for options.
tick_typeYesLast: trades reported to the consolidated tape. AllLast: every trade including odd lots and off-exchange prints. BidAsk: every change of the best bid or ask. MidPoint: every change of the midpoint.
buffer_sizeNoHow many of the newest ticks the server keeps for you to read.
ignore_sizeNoBidAsk only: skip updates that change only a size.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYesWhat it streams for: the contract id plus parameters.
kindYesWhat streams: quotes, depth, tick_by_tick, realtime_bars, bars, scanner, news_bulletins, news or display_group.
contractNoThe instrument, when there is one.
created_atYes
idle_ttl_sYesSeconds without a read before it is cancelled.
deduplicatedNoTrue when an identical stream was already open and its handle was returned instead of opening a second one.
subscription_idYesHandle for get_subscription_data and unsubscribe.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior4/5

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

Annotations declare readOnlyHint=true and openWorldHint=true, so the safety profile is already known. The description adds valuable behavioral context beyond that: the ring-buffer semantics, oldest-first retrieval via get_subscription_data, UTC timestamps, the ~3-stream IBKR limit, deduplication of identical subscriptions, and the 10189/10190 error meanings. It does not contradict the annotations. A small gap is that it doesn't describe the exact shape of the returned handle or the buffered tick records, but the output schema likely covers that.

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 a single dense paragraph that front-loads the core action and then layers constraints and usage guidance in logical order. Every sentence earns its place: the ring-buffer behavior, the read path, the timestamp semantics, the IBKR limit, the deduplication, the data requirements with error codes, and the stop command. No filler or repetition of schema content.

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?

For a subscription tool with a rich output schema and 100% parameter coverage, the description covers everything an agent needs to invoke it correctly: what it does, how to read the data, the limits, the deduplication, the prerequisites, the error codes, and how to stop it. The sibling list shows related subscription tools, and this description clearly differentiates subscribe_tick_by_tick from subscribe_bars, subscribe_quotes, and subscribe_realtime_bars by naming the tick-level granularity and the ring-buffer read path.

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 description coverage is 100%, so the schema already documents all four parameters well. The description adds meaningful context beyond the schema: it explains the ring-buffer lifecycle (buffer_size relates to how many newest ticks are kept), the deduplication behavior tied to tick_type, and the error conditions tied to the contract's data subscription. It doesn't restate the schema's parameter docs, which is appropriate. The only reason it's not a 5 is that the description doesn't add much about ignore_size or the exact contract resolution nuances, but the schema already covers those.

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 specific verb and resource: 'Start recording every trade, quote change or midpoint of one contract into a ring buffer.' It clearly distinguishes this from sibling subscription tools by naming the exact data granularity (tick-by-tick) and the ring-buffer behavior. The title 'Stream tick-by-tick data' is reinforced, not merely restated.

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 gives explicit when-to-use context: it names the companion get_subscription_data for reading buffered ticks, explains the IBKR limit of ~3 streams and that the server refuses more, and states the one-stream-per-contract/tick_type deduplication behavior. It also tells the agent to stop it with unsubscribe and warns about live-data/market-data-subscription requirements with specific error codes. This is comprehensive routing and prerequisite guidance.

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