Skip to main content
Glama
aiordanescu

ib-gateway-mcp

by aiordanescu

Contract details

get_contract_details
Read-only

Retrieve complete Interactive Brokers contract details—identifiers, trading sessions, order types, and more—for any instrument specified by symbol, con_id, or security ID.

Instructions

Return IBKR's full contract details for every instrument a spec matches.

For each contract: identifiers (con_id, local symbol, trading class, multiplier),
long name (`contract.description`), industry and category, stock type, the
exchange time zone, trading and liquid (regular-hours) sessions for about the next
week with closed days, min tick, size increments, valid exchanges with their market
rule ids (same order; see get_market_rule), accepted order types, ISIN and other
security ids, the underlying of a derivative, and bond terms for bonds.

The contract may be partial: symbol + sec_type FUT + exchange lists every future expiry.
Derivatives are sorted by expiry, strike and right; `limit` defaults to 20 (cap 200),
`total` and `truncated` say how many matched. Broad option specs are slow and
throttled by IBKR: use get_option_chain for expiries and strikes, then look up single
options. Futures and indexes need their listing exchange (CME, CBOE...), not SMART;
set include_expired for expired futures. Errors: not_found for an unknown
instrument; invalid_request for combos (BAG).

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.
contractYesThe instrument. A con_id alone is unambiguous; otherwise give symbol and sec_type, plus expiry, strike and right for options.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
totalYesDistinct contracts IBKR matched before the limit.
contractsYes
truncatedNoTrue when the result was cut to the limit.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

Beyond the readOnlyHint/openWorldHint annotations, the description discloses that partial contracts can match multiple instruments, derivatives are sorted by expiry/strike/right, limit defaults to 20 with a cap of 200, and total/truncated report match counts. It also surfaces throttling for broad option specs and names expected error types.

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 text is dense but every sentence earns its place: purpose, output fields, matching behavior, performance caveats, and errors are arranged logically. It is front-loaded with the core purpose and returns info before moving into caveats and alternatives.

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?

The description covers what the tool returns, how partial specs behave, pagination semantics, performance considerations, exchange prerequisites, and error cases. With a rich input schema and output schema present, nothing essential for invoking the tool correctly is missing.

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 100%, so the schema already documents the parameters thoroughly. The description adds meaningful value on top: it explains partial-spec matching (e.g., symbol + sec_type FUT + exchange lists every future expiry), gives the concrete limit default/cap, and clarifies include_expired's role in a usage context.

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 'Return IBKR's full contract details for every instrument a spec matches,' a specific verb and resource. It then enumerates the concrete returned fields (identifiers, sessions, min tick, accepted order types, bond terms), making the scope unmistakable and clearly distinct from sibling tools like search_symbols or qualify_contract.

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?

It gives direct routing advice: for broad option specs, 'use get_option_chain for expiries and strikes, then look up single options.' It also warns that futures and indexes need their listing exchange rather than SMART, recommends include_expired for expired futures, and states that combos (BAG) are rejected with invalid_request. This is explicit when/how-to-use guidance.

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