Skip to main content
Glama
yfinance-agent-mcp

yfinance-agent-mcp

by n-kostadinov

Get price history

get_price_history
Read-only

Retrieve adjusted price history for up to 10 symbols and get returns, moving averages, RSI, ATR, 52-week range, and volume ratio for trend and momentum analysis.

Instructions

Price history for up to 10 symbols, with ready-made indicators.

The summary saves you computing trend and momentum yourself: changes over 1d to 1y and YTD, SMA 20/50/200, RSI 14, ATR 14, 52-week range and volume vs. average. Prices are adjusted for splits and dividends.

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": {
      "symbols": "<symbols>"
    },
    "name": "get_price_history"
  }
}

Input Schema

NameRequiredDescriptionDefault
endNoDay after the last bar (YYYY-MM-DD); needs start.
barsNoHow many of the most recent bars to return.
modeNo'summary' adds returns, moving averages, RSI, ATR, 52-week range and volume ratio to the last bars; 'bars' returns bars only.summary
startNoFirst day (YYYY-MM-DD); overrides period.
periodNoHow far back to look; ignored when start is given.6mo
symbolsYesUp to 10 Yahoo Finance symbols, e.g. ['AAPL', 'SAP.DE', 'BTC-USD', '^GSPC', 'EURUSD=X'].
intervalNoBar length. Intraday bars cover the last 60 days (1m: 7 days).1d
response_formatNo'concise' (default; up to 20,000 characters) or 'detailed' (up to 80,000).concise

Output Schema

NameRequiredDescriptionDefault
endNo
modeYes
as_ofYesWhen this data was fetched from Yahoo Finance, in UTC.
startNo
errorsYes
periodNoRange asked for, when no start date.
pricesYes
sourceNoData source and the yfinance version.
intervalYes
warningsNoCaveats such as delayed quotes, symbols that failed, or trimmed results.
truncatedNoTrue when rows were left out to keep the response small.
next_offsetNoPass as `offset` to fetch the next rows, when the result is truncated.

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 cover the safety profile (readOnlyHint, openWorldHint), and the description adds genuinely new behavioral context: prices are split- and dividend-adjusted, and the summary payload includes specific derived fields (1d–1y and YTD changes, SMA 20/50/200, RSI 14, ATR 14, 52-week range, volume ratio). It does not disclose data latency, rate limits, or behavior when a symbol is invalid or unavailable.

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?

Two short blocks, front-loaded with the core capability before the indicator breakdown. The indicator enumeration is dense but earns its place by telling the agent what the default mode returns; nothing is padded.

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?

With an output schema present and 100% parameter coverage, the description only needs to convey scope and the nature of the returned data, which it does, including the adjustment methodology. Missing latency and error-handling notes are minor for a read-only market-data lookup.

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 every parameter (mode, period, start/end, interval, bars, response_format) is already documented with enums and defaults. The description largely restates the indicator set already enumerated in the mode field, adding no syntax or format detail beyond the schema; baseline 3 applies.

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?

"Price history for up to 10 symbols, with ready-made indicators" states the resource (historical OHLC bars) and the added value (precomputed indicators) in one line. It implicitly separates itself from quote-oriented siblings like get_live_quotes, but never names an alternative or explicitly says it is historical rather than real-time.

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 line "The summary saves you computing trend and momentum yourself" implies you should use the default summary mode when indicators are wanted, which is a usable hint. However, there is no explicit when-to-use/when-not-to-use framing and no pointer to any sibling such as get_quotes or get_live_quotes for current pricing.

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