Skip to main content
Glama
lkcair

yfinance-ai MCP server

by lkcair

get_historical_data

Read-onlyIdempotent

Retrieve historical stock price data for a given ticker and period, with selectable intervals, returning summary statistics and returns for market analysis.

Instructions

Get historical price data for a stock.

Args: ticker: Stock ticker symbol period: Time period - valid values: 1d, 5d, 1mo, 3mo, 6mo, 1y, 2y, 5y, 10y, ytd, max interval: Data interval - valid values: 1m, 2m, 5m, 15m, 30m, 60m, 90m, 1h, 1d, 5d, 1wk, 1mo, 3mo

Returns: Historical price data summary with statistics and returns

Example: >>> await get_historical_data("AAPL", period="6mo", interval="1d")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
periodNo1y
tickerYes
intervalNo1d

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive/openWorld, so the safety bar is covered. The description adds real value beyond them by disclosing the return shape ('summary with statistics and returns') rather than raw bars, which materially affects how an agent consumes the result.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded one-line purpose followed by Args/Returns/Example blocks — every section is useful. The example is slightly redundant for a 3-parameter tool but is cheap and correct.

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?

Covers all parameters, return shape, and a working example even though an output schema exists. Minor gap: it doesn't note that short intervals (1m/2m) are only valid with short periods, nor that a ticker may need validation first.

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 coverage is 0% with no declared enums, yet the description enumerates valid values for both period (1d…max) and interval (1m…3mo) and explains each parameter. This fully compensates for the empty schema and prevents invalid calls.

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?

States a specific verb+resource: 'Get historical price data for a stock.' An agent can distinguish this from get_stock_price (quote) and get_historical_price_on_date (single date), but the description never explicitly names those adjacent siblings, so a 5 isn't earned.

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 offers no when-to-use guidance, no conditions selecting it over get_historical_price_on_date, get_historical_comparison, or get_stock_quote, and no prerequisites. All content is parameter documentation, not usage routing.

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