Skip to main content
Glama
alpacahq

alpaca-mcp-server

Official
by alpacahq

Get Stock Trades

get_stock_trades
Read-only

Retrieve historical stock trades for one or more symbols, with configurable time windows, relative lookback, and feed options for market analysis.

Instructions

Retrieve historical trade data for one or more stocks.

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.
asofNoAs-of date (YYYY-MM-DD) for point-in-time symbol mapping.
daysNoDays to look back when start is omitted (default 0).
feedNoData feed — "sip" (all US exchanges, default, paid), "iex" (free tier), "otc", or "boats". Paper/free accounts must set feed="iex" to avoid 403 errors.
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 20).
symbolsYesComma-separated tickers (e.g. "AAPL" or "AAPL,MSFT").
currencyNoPrice currency (ISO 4217). Default USD.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed11 schema fields changedv2.3.2
    • addedInput schema / properties / asof / description
      Added value: +"As-of date (YYYY-MM-DD) for point-in-time symbol mapping."
    • addedInput schema / properties / currency / description
      Added value: +"Price currency (ISO 4217). Default USD."
    • addedInput schema / properties / days / description
      Added value: +"Days to look back when start is omitted (default 0)."
    • addedInput schema / properties / end / description
      Added value: +"Inclusive end time (RFC 3339). Omit for current time."
    • addedInput schema / properties / feed / description
      Added value: +"Data feed — \"sip\" (all US exchanges, default, paid),\n  \"iex\" (free tier), \"otc\", or \"boats\".\n  Paper/free accounts must set feed=\"iex\" to avoid 403 errors."
    • 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 20)."
    • 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 tickers (e.g. \"AAPL\" or \"AAPL,MSFT\")."
  2. Addedv2.0.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true. The description adds a specific behavioral detail beyond annotations: the automatic lookback computation when start is omitted. This provides useful context for how the tool behaves. No contradiction with annotations; the description is consistent with a read-only operation.

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 with no redundancy. The main purpose is front-loaded in the first sentence, and the second sentence provides a key behavioral detail. Every word earns its place, and the structure is clean.

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?

For a tool with 11 parameters, the description plus a 100% schema cover the parameter semantics, and an output schema covers return structure. Annotations provide safety. The description adds the crucial default-start behavior. However, it lacks guidance on tool selection among trade-related siblings, which is a minor gap but does not prevent correct invocation given the schemas.

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 coverage is 100%, so all parameters have descriptions. The tool description only reinforces the start/lookback behavior that is already partially documented in the schema ('Omit to use relative lookback'). It does not add significant new meaning for other parameters. Given the high schema coverage, a baseline of 3 is appropriate.

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 the verb and resource: 'Retrieve historical trade data for one or more stocks.' It distinguishes itself from siblings like get_stock_latest_trade (latest trade) and get_stock_bars (bars) by specifying historical trade data. No ambiguity about what it does.

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

Usage Guidelines3/5

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

The description implies usage for historical trades but does not explicitly state when to use this tool versus alternatives. It mentions a behavioral nuance about the default start computation, but lacks guidance on choosing among the many sibling trade-related tools. No exclusions or alternatives are specified.

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