Skip to main content
Glama

historical_data

Fetch OHLCV historical bars for Interactive Brokers contracts by symbol or conId with configurable duration, bar size, and data type to analyze price trends.

Instructions

Get OHLCV historical bars. Supports durations like "1 D", "1 W", "1 M", "1 Y". Bar sizes: "1 min", "5 mins", "1 hour", "1 day", etc.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "durationStr": "<durationStr>",
      "barSizeSetting": "<barSizeSetting>"
    },
    "name": "historical_data"
  }
}

Input Schema

NameRequiredDescriptionDefault
conIdNo
symbolNo
useRTHNoRegular trading hours only (default: true)
secTypeNo
currencyNo
exchangeNo
whatToShowNoData type: TRADES, MIDPOINT, BID, ASK, etc.
durationStrYesDuration: "1 D", "5 D", "1 W", "1 M", "3 M", "1 Y"
endDateTimeNoEnd date/time (YYYYMMDD HH:mm:ss TZ or empty for now)
barSizeSettingYesBar size: "1 min", "5 mins", "15 mins", "1 hour", "1 day"

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.1

TDQS

C2.7/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It discloses that the output is OHLCV bars, which is useful, but says nothing about pacing/rate limits typical of historical bar requests, whether data is trimmed to regular trading hours by default, what happens when the identifier is incomplete, or the shape of the response.

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?

Three short sentences with the core purpose front-loaded and no filler. It is efficient, though the format examples largely duplicate schema content rather than adding new information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With 10 parameters, no annotations, and no output schema, the description should at least explain the two identification paths (conId alone vs symbol plus secType/exchange/currency) and default behavior. It covers none of that, leaving the agent to infer critical calling conventions from the schema alone.

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

Parameters2/5

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

Schema description coverage is 50%, so the description needs to compensate — but the two things it does explain (duration and bar-size formats) are already documented in the schema descriptions for durationStr and barSizeSetting. The identifier parameters (conId vs symbol/secType/exchange/currency), whatToShow, useRTH, and endDateTime receive no added meaning from the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb and resource: 'Get OHLCV historical bars.' That is clearly distinguishable from siblings like historical_ticks or market_data_snapshot by the OHLCV bar framing. It does not explicitly state the boundary against those siblings, which keeps it from a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

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

There is no when-to-use guidance, no prerequisites, and no mention of alternatives such as historical_ticks or historical_news. The only guidance given is about input formatting (durations and bar sizes), not about selecting this tool over another.

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

Deploy Server

Other Tools