Skip to main content
Glama
alpacahq

alpaca-mcp-server

Official
by alpacahq

Get Crypto Bars

get_crypto_bars
Read-only

Retrieve historical OHLCV price bars for one or more crypto pairs. Set symbols, timeframe, and lookback period to obtain market data for analysis, backtesting, or strategy development.

Instructions

Retrieve historical price bars (OHLCV) for one or more cryptocurrencies.

When start is omitted, it is automatically computed as now minus the days/hours/minutes lookback.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endNoInclusive end time (RFC 3339). Omit for current time.
daysNoDays to look back when start is omitted (default 1).
sortNoTimestamp sort order — "asc" (default) or "desc".asc
hoursNoAdditional hours in the lookback (default 0).
limitNoMax total data points returned across all symbols, 1–10000 (default 1000).
startNoInclusive start time (RFC 3339). Omit to use relative lookback.
minutesNoAdditional minutes in the lookback (default 0).
symbolsYesComma-separated crypto pairs (e.g. "BTC/USD" or "BTC/USD,ETH/USD").
timeframeNoBar aggregation period — "1Min", "5Min", "15Min", "30Min", "1Hour", "1Day", "1Week", or "1Month".1Hour

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changedv2.3.2
    • addedInput schema / properties / days / description
      Added value: +"Days to look back when start is omitted (default 1)."
    • addedInput schema / properties / end / description
      Added value: +"Inclusive end time (RFC 3339). Omit for current time."
    • addedInput schema / properties / hours / description
      Added value: +"Additional hours in the lookback (default 0)."
    • addedInput schema / properties / limit / description
      Added value: +"Max total data points returned across all symbols,\n   1–10000 (default 1000)."
    • addedInput schema / properties / minutes / description
      Added value: +"Additional minutes in the lookback (default 0)."
    • addedInput schema / properties / sort / description
      Added value: +"Timestamp sort order — \"asc\" (default) or \"desc\"."
    • addedInput schema / properties / start / description
      Added value: +"Inclusive start time (RFC 3339). Omit to use relative lookback."
    • addedInput schema / properties / symbols / description
      Added value: +"Comma-separated crypto pairs (e.g. \"BTC/USD\" or\n     \"BTC/USD,ETH/USD\")."
    • addedInput schema / properties / timeframe / description
      Added value: +"Bar aggregation period — \"1Min\", \"5Min\", \"15Min\",\n       \"30Min\", \"1Hour\", \"1Day\", \"1Week\", or \"1Month\"."
  2. Addedv2.0.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint and openWorldHint, so the read-only nature is established. The description adds a useful behavioral detail—the automatic start-time computation from days/hours/minutes—which is not fully expressed in the schema. However, it does not address pagination, response ordering, or any cross-symbol aggregation behavior, so it only modestly extends annotation coverage.

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 two sentences: a clear purpose statement followed by the one meaningful default behavior. It is front-loaded and contains no filler. Every sentence earns its place.

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

Completeness4/5

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

Given the rich input schema, an output schema, and safety annotations, the description is largely sufficient for invoking the tool correctly. It could be more complete by contrasting with get_crypto_latest_bar or noting when this endpoint should be preferred, but that gap is more about selection guidance than call correctness. The auto-start sentence is a valuable addition for a 9-parameter tool.

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%, with each of the 9 parameters already documented (types, defaults, enumerated timeframe values, and RFC 3339 formats). The description adds no new parameter semantics beyond grouping days/hours/minutes into the lookback computation. Baseline 3 is appropriate because the schema does the heavy lifting.

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 'Retrieve historical price bars (OHLCV) for one or more cryptocurrencies,' which names a specific verb, resource, and scope. The word 'historical' helps separate it from get_crypto_latest_bar and get_crypto_snapshot. It is unambiguous even without naming a sibling.

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?

The description provides no explicit when-to-use or when-not-to-use guidance and does not reference any alternative tools like get_crypto_latest_bar or get_stock_bars. The only secondary sentence concerns default start-time computation, not selection context. This leaves an agent to infer applicability from the tool's name and purpose.

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