Skip to main content
Glama
alpacahq

alpaca-mcp-server

Official
by alpacahq

get_option_bars

Fetch historical OHLCV bars for option contracts by symbol, timeframe, and date range, with pagination and sorting for market analysis.

Instructions

Retrieves historical bar (OHLCV) data for one or more option contracts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endNoThe inclusive end of the interval. Format: RFC-3339 or YYYY-MM-DD. Default: the current time if the user has a real-time access for the feed, otherwise 15 minutes before the current time.
sortNoSort data in ascending or descending order.
limitNoThe maximum number of data points to return in the response page. The API may return less, even if there are more available data points in the requested interval. Always check the `next_page_token` for more pages. The limit applies to the total number of data points, not per symbol!
startNoThe inclusive start of the interval. Format: RFC-3339 or YYYY-MM-DD. Default: the beginning of the current day, but at least 15 minutes ago if the user doesn't have real-time access for the feed.
symbolsYesA comma-separated list of contract symbols with a limit of 100.
timeframeYesThe timeframe represented by each bar in aggregation. You can use any of the following values: - `[1-59]Min` or `[1-59]T`, e.g. `5Min` or `5T` creates 5-minute aggregations - `[1-23]Hour` or `[1-23]H`, e.g. `12Hour` or `12H` creates 12-hour aggregations - `1Day` or `1D` creates 1-day aggregations - `1Week` or `1W` creates 1-week aggregations - `[1,2,3,4,6,12]Month` or `[1,2,3,4,6,12]M`, e.g. `3Month` or `3M` creates 3-month aggregations
page_tokenNoThe pagination token from which to continue. The value to pass here is returned in specific requests when more data is available, usually because of a response result limit.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv2.3.2
    • addedInput schema / properties / sort / allOf
      Added value: +[
      +  {
      +    "default": "asc",
      +    "description": "Sort data in ascending or descending order.",
      +    "enum": [
      +      "asc",
      +      "desc"
      +    ],
      +    "type": "string"
      +  }
      +]
    • removedInput schema / properties / sort / default
      Removed value: -"asc"
    • removedInput schema / properties / sort / enum
      Removed value: -[
      -  "asc",
      -  "desc"
      -]
    • removedInput schema / properties / sort / x-go-name
      Removed value: -"TypeSort"
  2. Addedv2.0.0

TDQS

B3.1/5.0
Behavior2/5

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

With no annotations, the description carries the full burden of behavioral disclosure, but it offers only a single sentence covering the basic retrieval action. It omits pagination behavior, default start/end semantics, and real-time access constraints that the schema parameter descriptions mention.

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?

A single, front-loaded sentence is efficient and appropriately sized. It could be slightly richer, but it wastes no words and the core purpose is immediately visible.

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?

Even with an output schema provided, the description is incomplete for tool selection. It lacks usage guidance, behavioral notes, and any differentiation from sibling bar/quote/trade tools, so an agent would have to infer when to invoke it.

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%, so the baseline is 3. The description only hints at the 'symbols' parameter via 'one or more option contracts' and adds no meaning beyond the detailed per-parameter documentation already present in the schema.

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 ('Retrieves'), names the exact resource ('historical bar (OHLCV) data'), and targets 'one or more option contracts'. This clearly distinguishes it from stock and crypto bar siblings without needing to open the schema.

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?

No guidance is given on when to use this tool versus alternatives like get_option_trades, get_option_contract, or get_stock_bars. The description only states what the tool does, not the conditions that select it.

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