Skip to main content
Glama
bartest5

Alpaca MCP Server

by bartest5

Get Stock Bars

get_stock_bars
Read-only

Fetch historical OHLCV price bars for stocks with customizable timeframe, date range, and adjustment options, enabling price trend analysis and trading strategy backtesting.

Instructions

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

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

Args: symbols: Comma-separated tickers (e.g. "AAPL" or "AAPL,MSFT,GOOG"). timeframe: Bar aggregation period — "1Min", "5Min", "15Min", "30Min", "1Hour", "1Day", "1Week", or "1Month". start: Inclusive start time (RFC 3339). Omit to use relative lookback. end: Inclusive end time (RFC 3339). Omit for current time. days: Days to look back when start is omitted (default 5). hours: Additional hours in the lookback (default 0). minutes: Additional minutes in the lookback (default 0). limit: Max total data points returned across all symbols, 1–10000 (default 1000). adjustment: Price adjustment — "raw", "split", "dividend", "spin-off", or "all". Comma-separated combos allowed (e.g. "split,dividend"). Default "raw". feed: Data feed — "sip" (all US exchanges, default, paid), "iex" (IEX only, free tier), "otc", or "boats". currency: Price currency (ISO 4217, e.g. "USD"). Default USD. sort: Timestamp sort order — "asc" (default) or "desc". asof: As-of date (YYYY-MM-DD) for point-in-time symbol mapping. Useful for backtesting with historical ticker changes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endNo
asofNo
daysNo
feedNo
sortNoasc
hoursNo
limitNo
startNo
minutesNo
symbolsYes
currencyNo
timeframeNo1Day
adjustmentNoraw

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

Annotations already declare readOnlyHint=true, so the agent knows this is a safe read operation. The description adds valuable behavioral context beyond that: automatic lookback computation, feed options with paid/free distinctions (sip vs iex), limit semantics across symbols, and asof for point-in-time mapping. This is substantive, though it doesn't cover error cases or rate limits.

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 front-loaded with a single-sentence purpose, then a well-structured Args block where each parameter gets one concise, informative line. Despite covering 13 parameters, it remains readable and every sentence earns its place.

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 the tool has 13 parameters, an output schema, and annotations, the description covers all parameter behaviors, defaults, and special cases (asof for backtesting, feed tiers, adjustment options). No significant gaps are apparent; return values are already documented by the output schema.

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

Parameters5/5

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

Schema description coverage is 0%, so the description carries the full burden, and it delivers thoroughly. Every one of the 13 parameters is listed with a clear definition, default value, and often explicit examples (e.g., 'AAPL,MSFT,GOOG' for symbols, allowed adjustment combos, feed options). This fully compensates for the schema's lack of 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 opens with a specific verb 'Retrieve' plus a clear resource ('historical price bars (OHLCV) for one or more stocks'), making the tool's core function immediately obvious. It also distinguishes this tool from siblings like get_crypto_bars and get_option_bars by explicitly limiting it to stocks.

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 provides useful usage context, such as how start is automatically computed when omitted and how limit caps data across all symbols. However, it doesn't explicitly name alternatives or state when not to use this tool relative to siblings like get_stock_quotes or get_crypto_bars, so it stops short of a 5.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bartest5/alpacahq_alpaca-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server