Skip to main content
Glama
Yahoo Finance MCP Server

Yahoo Finance MCP Server

yfinance_get_stock_history

Read-only

Retrieve historical stock price data for any ticker with configurable period and interval. Return full price series, limited recent data points, or summary statistics to analyze trends, volume, and price ranges.

Instructions

Get historical price data for a stock with customizable time period and interval.

Args: ticker: Stock ticker symbol (e.g., 'AAPL', 'MSFT', 'GOOGL') period: Time period - valid values: 1d, 5d, 1mo, 3mo, 6mo, 1y, 2y, 5y, 10y, ytd, max (default: '1mo') interval: Data interval - valid values: 1m, 2m, 5m, 15m, 30m, 60m, 90m, 1h, 1d, 5d, 1wk, 1mo, 3mo (default: '1d') limit: Maximum number of most recent data points to return (default: None, returns all) summary: If True, return summary statistics instead of all data points (default: False) response_format: Output format - 'json' or 'markdown' (default: 'markdown')

Returns: Formatted string with historical price data or summary statistics. When summary=True, returns: high, low, avg close, total volume, start/end dates. When limit is set, returns only the N most recent data points.

Example: yfinance_get_stock_history("AAPL", "1y", "1d", "json") yfinance_get_stock_history("AAPL", "1y", "1d", limit=30) # Last 30 days yfinance_get_stock_history("AAPL", "1y", "1d", summary=True) # Just summary

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": "yfinance_get_stock_history"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNo
periodNo1mo
tickerYes
summaryNo
intervalNo1d
response_formatNomarkdown

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint and openWorldHint, so the safety profile is covered; the description adds behavior annotations don't carry — that limit returns only the N most recent points and that summary=True swaps the payload for aggregate statistics with a named field list. It does not mention pagination, data source latency, or rate limiting, which would round out the disclosure.

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?

The purpose is front-loaded and the Args/Returns/Example blocks are well organized and scannable. The Returns section overlaps with the existing output schema, and the examples restate values already listed in Args, so a little trimming is possible without losing information.

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 six-parameter read-only data tool, the definition covers purpose, every parameter's allowed values, and the two payload-shape switches (limit and summary). The Returns block is largely redundant given the output schema, but nothing an agent needs in order to call it correctly is missing.

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 entire burden and does so: every one of the six parameters gets a meaning, the enumerable ones get full valid-value lists, and defaults are restated. It adds real semantics beyond the schema, e.g. that limit takes 'most recent' points and summary substitutes statistics for raw rows.

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 opening sentence names a specific verb and resource ('Get historical price data for a stock') and scopes it to 'customizable time period and interval', which clearly separates it from siblings like yfinance_get_stock_info or yfinance_get_stock_financials. No sibling is named explicitly, so it lands at 4 rather than 5.

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?

There is no explicit when-to-use or when-not-to-use guidance and no mention of alternatives, but the three worked examples implicitly demonstrate the main usage modes (plain history, last-N via limit, summary=True). The agent must infer selection criteria from the examples rather than being told.

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