Skip to main content
Glama

Get Historical Stock Prices

get_historical_prices
Read-only

Get historical OHLCV price candles for a stock at daily, weekly or monthly resolution, for a period shorthand (1M, 3M, 6M, 1Y, 5Y or the full history) or an explicit from/to UNIX timestamp window. The default is one year of daily candles.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "ticker": "<ticker>"
    },
    "name": "get_historical_prices"
  }
}

Input Schema

NameRequiredDescriptionDefault
toNoEnd date as UNIX timestamp (overrides period)
fromNoStart date as UNIX timestamp (overrides period)
periodNoLookback period shorthand (default: "1Y"). Ignored if from/to are provided.
tickerYesStock ticker symbol (e.g., "AAPL", "TSLA")
resolutionNoCandle resolution: "D" (daily, default), "W" (weekly), "M" (monthly)

Output Schema

NameRequiredDescriptionDefault
dataNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed11 schema fields changed
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / from / description
      Added value: +"Start date as UNIX timestamp (overrides period)"
    • removedInput schema / properties / from / maximum
      Removed value: -9007199254740991
    • removedInput schema / properties / from / minimum
      Removed value: --9007199254740991
    • addedInput schema / properties / period / description
      Added value: +"Lookback period shorthand (default: \"1Y\"). Ignored if from/to are provided."
    • addedInput schema / properties / resolution / description
      Added value: +"Candle resolution: \"D\" (daily, default), \"W\" (weekly), \"M\" (monthly)"
    • addedInput schema / properties / ticker / description
      Added value: +"Stock ticker symbol (e.g., \"AAPL\", \"TSLA\")"
    • addedInput schema / properties / to / description
      Added value: +"End date as UNIX timestamp (overrides period)"
    • removedInput schema / properties / to / maximum
      Removed value: -9007199254740991
    • removedInput schema / properties / to / minimum
      Removed value: --9007199254740991
    • removedOutput schema / required
      Removed value: -[
      -  "data"
      -]
  2. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "data": {}
      +  },
      +  "required": [
      +    "data"
      +  ],
      +  "type": "object"
      +}
  3. First observed

TDQS

A3.8/5.0
Behavior4/5

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

The annotations already establish that this is a safe read-only operation. Beyond that, the description adds useful behavioral detail: daily/weekly/monthly resolutions, supported period shorthands, from/to override behavior, and the default of one year of daily candles.

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 tightly written sentences with no wasted wording. It front-loads the core operation and then supplies the period, resolution, and default behavior an agent needs.

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, existing annotations, and presence of an output schema, the description is mostly complete for invocation. A minor gap is that it does not clarify price-adjustment behavior or mention relevant sibling alternatives, but nothing required to call the tool correctly is missing.

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 schema already documents ticker, period, resolution, from, and to. The description reinforces the enum values and override/default behavior, but adds little semantic detail beyond the structured parameter documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: fetching historical OHLCV price candles for a stock. It also scopes the tool by resolution and period, which makes it clearly different from quote or intraday-style tools, though it does not name an alternative sibling explicitly.

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?

Usage is implied by the historical-price framing and the stated defaults, but the description does not explicitly say when to use this instead of siblings such as get_intraday_bars or get_quote. It provides enough context to call the tool, but not explicit routing guidance.

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.