Skip to main content
Glama
Yahoo Finance MCP Server

Yahoo Finance MCP Server

get_historical_prices

Read-onlyIdempotent

Retrieve a stock's historical OHLCV prices for a chosen period and interval, with summary statistics and total return for performance, trend, or charting analysis.

Instructions

Historical OHLCV price series for one stock over a chosen period/interval, plus summary stats (highest/lowest/average close, average volume) and total return over the window.

Use for performance, trends, or charting ("how has X done over the last year"). For a single current price use get_stock_quote; for dividend/split events use get_dividends_splits. Note: intraday intervals (1m-90m) are only available for short recent periods, and long periods return many rows, so prefer JSON or a shorter period if the output is truncated.

Returns Markdown (summary stats plus the last 10 rows) by default, or the full series as JSON when response_format='json'. An empty or unsupported period/interval combination returns a short message.

Input Schema

NameRequiredDescriptionDefault
periodNoTime period for historical data (e.g., '1mo' for 1 month, '1y' for 1 year)1mo
tickerYesStock ticker symbol (e.g., 'AAPL', 'GOOGL', 'MSFT')
intervalNoData interval (e.g., '1d' for daily, '1h' for hourly)1d
response_formatNoOutput format: 'markdown' for human-readable or 'json' for machine-readablemarkdown

Output Schema

NameRequiredDescriptionDefault
dataNo
noteNo
periodNo
tickerNo
messageNoSet instead of data when there is nothing to return for this request (for example, no dividends on record).
intervalNo
truncatedNoTrue when only the newest records fit the response limit.
totalRecordsNo
returnedRecordsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.6.0

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already establish the safety profile (readOnlyHint, idempotentHint, destructiveHint=false, openWorldHint), so the description is not obligated to restate them. It adds genuinely non-obvious behavior instead: default output is a truncated Markdown view, full series only via response_format='json', and unsupported period/interval pairs return a short message rather than an error. It does not mention rate limits or data-source latency, which keeps it off a 5.

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?

Three short paragraphs ordered by importance: what it returns, when to use it versus alternatives, then output/edge-case mechanics. Every sentence carries distinct information, and the parenthetical example is anchored rather than decorative.

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?

For a four-parameter read-only data tool with full schema coverage and an output schema, everything an agent needs to call it correctly is present: default behavior, format switch, interval/period compatibility, and truncation risk. The return-value detail is arguably redundant given the output schema, but it costs nothing and resolves ambiguity about default truncation.

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 the baseline is 3; the description nonetheless adds real meaning by explaining the semantic effect of response_format (markdown = summary stats plus last 10 rows vs json = full series) and by tying interval choice to period length. It does not expand the period/interval enums beyond the schema's own examples, so it stops short of a 5.

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?

Opens with a specific verb+resource combination: 'Historical OHLCV price series for one stock over a chosen period/interval', and immediately enumerates the included derivatives (summary stats, total return). It also explicitly names the two sibling tools it is not (get_stock_quote for current price, get_dividends_splits for corporate actions), so an agent can disambiguate without opening any schema.

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

Usage Guidelines5/5

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

Gives an explicit when-to-use framing ('how has X done over the last year') plus named alternatives with the exact condition that selects them: single current price -> get_stock_quote, dividend/split events -> get_dividends_splits. It further constrains usage with a practical caveat that intraday intervals only work for short recent periods and long periods may truncate.

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