Skip to main content
Glama

Alpaca Bars

alpaca_bars
Read-onlyIdempotent

Historical US stock OHLCV bars with per-bar VWAP and trade count. Timeframes 1Min/5Min/15Min/1Hour/1Day; intraday bars include pre-market and after-hours sessions on the IEX feed. Each bar: {t, o, h, l, c, v, vwap, trades}. Use start/end ISO timestamps or a lookback shorthand like "2h", "5d". Multiple symbols comma-separated (max 20). BYOK Alpaca (free account). Example: alpaca_bars({ symbols: "AAPL", timeframe: "5Min", lookback: "1d", _apiKey: "key_id:secret_key" })

Input Schema

NameRequiredDescriptionDefault
endNoEnd time, ISO/RFC-3339 or date (default: now)
limitNoMax bars per symbol to return, 1-1000 (default 100)
startNoStart time, ISO/RFC-3339 (e.g. "2026-07-18T09:30:00-04:00") or date "2026-07-18"
_apiKeyYesREQUIRED: your Alpaca credentials as "key_id:secret_key" — both halves joined by a colon. Free at alpaca.markets (a paper-trading account is enough for market data).
symbolsYesComma-separated ticker symbols, e.g. "AAPL,MSFT" (max 20)
lookbackNoShorthand window ending now, instead of start/end: e.g. "30m", "2h", "1d", "5d", "2w"
timeframeNoBar size: "1Min", "5Min", "15Min", "1Hour", or "1Day" (default "5Min")

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "_apiKey": "your-alpaca-api-key",
      +    "lookback": "1d",
      +    "symbols": "AAPL",
      +    "timeframe": "5Min"
      +  },
      +  {
      +    "_apiKey": "your-alpaca-api-key",
      +    "end": "2026-07-25",
      +    "start": "2026-07-18",
      +    "symbols": "MSFT,TSLA",
      +    "timeframe": "1Hour"
      +  }
      +]
  2. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations declare readOnlyHint=true, idempotentHint=true, destructiveHint=false, which are consistent. The description adds valuable behavioral context: uses IEX feed, includes pre-market and after-hours sessions, and specifies data shape. No contradictions.

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 concise (three sentences plus an example) with no filler. It front-loads the core functionality and quickly covers key details like timeframes, feed, and data fields.

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?

Given no output schema, the description sufficiently explains return structure (fields like t, o, h, l, c, v, vwap, trades). It covers input parameters, API key requirement, and limitations (max symbols, lookback shorthand). Complete for a data retrieval tool.

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 baseline is 3. The description adds examples illustrating shorthand lookback usage and explains that multiple symbols are allowed (max 20). This provides practical context beyond schema descriptions.

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 clearly states it provides 'Historical US stock OHLCV bars with per-bar VWAP and trade count' and lists supported timeframes. It distinguishes from siblings like 'alpaca_snapshot' (real-time snapshots) and 'alpaca_intraday_vwap' (likely a different data product).

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

Usage Guidelines4/5

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

The description explains when to use (historical bars) and provides examples. It implicitly indicates not for real-time data, but does not explicitly exclude use cases or mention alternatives among siblings.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.