Skip to main content
Glama
Yahoo Finance MCP Server

Yahoo Finance MCP Server

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
HOMENoYour home directory path, set in the MCP server env configuration (e.g., /Users/yourusername).
MCP_TRANSPORTNoTransport to use for the server. By default STDIO transport is used. Set to 'sse' or 'streamable-http' to configure SSE or Streamable HTTP transport (e.g., MCP_TRANSPORT=streamable-http).stdio

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
yfinance_get_stock_infoA

Get comprehensive information about a stock including price, market cap, ratios, and company details.

Args: ticker: Stock ticker symbol (e.g., 'AAPL', 'MSFT', 'GOOGL') fields: Optional list of field names to include (case-insensitive partial matching). Available fields: name, price, currency, market_cap, pe_ratio, forward_pe, dividend_yield, 52_week_high, 52_week_low, avg_volume, sector, industry, description (default: None, returns all fields) response_format: Output format - 'json' for structured data, 'markdown' for human-readable (default: 'markdown')

Returns: Formatted string containing stock information including: - Current price and currency - Market capitalization - PE ratios (trailing and forward) - Dividend yield - 52-week high/low - Average volume - Sector and industry - Company description

Example: yfinance_get_stock_info("AAPL", "json") yfinance_get_stock_info("TSLA", ["price", "market_cap", "pe_ratio"], "markdown") yfinance_get_stock_info("MSFT", fields=["sector", "industry"])

yfinance_get_stock_historyA

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

yfinance_get_stock_financialsA

Get financial statements for a stock (income statement, balance sheet, or cash flow statement).

Args: ticker: Stock ticker symbol (e.g., 'AAPL', 'MSFT', 'GOOGL') statement_type: Type of financial statement - 'income', 'balance', or 'cashflow' (default: 'income') period: Period type - 'quarterly' for quarterly reports, 'annual' for yearly reports (default: 'quarterly') limit: Maximum number of periods to return (default: 4) fields: List of specific line items to include. If None, returns all fields (default: None) response_format: Output format - 'json' or 'markdown' (default: 'markdown')

Returns: Formatted string containing the requested financial statement organized by date. Returns quarterly data by default (most recent 4 quarters). Use period='annual' to get annual/yearly financial statements instead. When fields is specified, only those line items are included.

Example: yfinance_get_stock_financials("AAPL", "income", "json") yfinance_get_stock_financials("AAPL", "income", period="annual", limit=3) # Last 3 years yfinance_get_stock_financials("AAPL", "income", limit=2, fields=["Total Revenue", "Net Income"])

yfinance_get_stock_recommendationsA

Get analyst recommendations and rating changes for a stock.

Args: ticker: Stock ticker symbol (e.g., 'AAPL', 'MSFT', 'GOOGL') limit: Maximum number of most recent recommendations to return (default: 20) response_format: Output format - 'json' or 'markdown' (default: 'markdown')

Returns: Formatted string containing analyst recommendations history including: - Date of recommendation - Firm name - Rating change (to grade, from grade) - Action taken

Example: yfinance_get_stock_recommendations("AAPL", "json") yfinance_get_stock_recommendations("AAPL", limit=10) # Only 10 most recent

yfinance_get_stock_newsA

Get recent news articles related to a stock.

Args: ticker: Stock ticker symbol (e.g., 'AAPL', 'MSFT', 'GOOGL') limit: Maximum number of news items to return (default: 10, max: 50) response_format: Output format - 'json' or 'markdown' (default: 'markdown')

Returns: Formatted string containing recent news articles with: - Article title - Article description/summary - Publisher name - Publication date and time - Article link - Content type - Thumbnail image URL

Example: yfinance_get_stock_news("TSLA", 5, "markdown")

yfinance_get_multiple_quotesA

Get current quotes for multiple stocks at once in a single request.

Args: tickers: List of stock ticker symbols (e.g., ['AAPL', 'MSFT', 'GOOGL']) response_format: Output format - 'json' or 'markdown' (default: 'markdown')

Returns: Formatted string containing current quotes for all requested tickers including: - Company name - Current price - Currency - Price change and percent change - Trading volume

Example: yfinance_get_multiple_quotes(["AAPL", "MSFT", "GOOGL"], "json")

yfinance_search_stocksA

Search for stocks by company name or ticker symbol to verify ticker validity.

Args: query: Search query (company name or ticker symbol) response_format: Output format - 'json' or 'markdown' (default: 'markdown')

Returns: Formatted string containing search results with: - Whether stock was found - Ticker symbol - Company name - Exchange - Security type

Example: yfinance_search_stocks("AAPL", "json") yfinance_search_stocks("Apple", "markdown")

Note: yfinance has limited search capabilities. This tool validates if a ticker exists.

yfinance_get_earnings_datesA

Get earnings calendar information including historical and upcoming earnings dates with estimates.

Args: ticker: Stock ticker symbol (e.g., 'AAPL', 'MSFT', 'GOOGL') limit: Maximum number of earnings dates to return (default: 12) future_only: If True, return only upcoming earnings dates (default: False) response_format: Output format - 'json' or 'markdown' (default: 'markdown')

Returns: Formatted string containing earnings information including: - Earnings dates (historical and/or upcoming) - EPS estimates - Reported EPS (for historical dates) - Surprise percentage (actual vs estimate)

Example: yfinance_get_earnings_dates("AAPL", "json") yfinance_get_earnings_dates("AAPL", limit=4) # Last 4 quarters yfinance_get_earnings_dates("AAPL", future_only=True) # Only upcoming

yfinance_get_options_chainA

Get options chain data for a stock. Returns call options near current price for the nearest expiration by default.

Args: ticker: Stock ticker symbol (e.g., 'AAPL', 'MSFT', 'GOOGL') expiration_date: Optional expiration date in 'YYYY-MM-DD' format (default: nearest) dte: Optional days to expiration - USE THIS for time-based queries: - 7 for "weekly options" - 30 for "monthly options" - 90 for "quarterly options" - 365 for "LEAPS" or "long-term options" MUTUALLY EXCLUSIVE with target_date - cannot use both (default: None, uses nearest expiration) target_date: Optional target date in 'YYYY-MM-DD' format to find closest expiration(s). USE THIS when query mentions a specific date like "around Dec 15" or "near January" MUTUALLY EXCLUSIVE with dte - cannot use both (default: None) limit: Number of closest expirations to return (works with dte or target_date). - 1 = single closest expiration (default) - 2 = two closest (one before, one after if possible) - 3+ = N closest expirations around the target EFFICIENCY: Always use limit parameter to get multiple expirations in ONE call, rather than making multiple separate calls with different dte values. (default: 1) option_type: 'calls', 'puts', or 'both' - Use 'both' when query mentions "what's available" or exploratory requests - Default: 'calls' strikes_near_price: Number of strikes above/below current price, or None for all (default: 10) in_the_money: True for ITM, False for OTM, None for both (default: None) min_volume: Minimum volume filter - ONLY use if query mentions "liquid" or "active" (default: None) min_open_interest: Minimum open interest filter - ONLY use if query mentions "liquid" or "active" (default: None) strike_min: Minimum strike price (default: None) strike_max: Maximum strike price (default: None) fields: Which fields/data to return. Special values: - ["expiration_dates"] or ["expirations"] = return only dates without contract data - None (default) = return full contract data Use for queries like "what expiration dates does [ticker] have?" summary: If True, return aggregate statistics instead of individual contracts. Returns: total volume, open interest, strike ranges, avg IV, most active strikes, put/call ratios. Use this for queries asking for "summary", "activity", "overview", or "sentiment" - NOT for queries asking for specific contracts/strikes. Works seamlessly with limit parameter to analyze multiple expirations. (default: False) response_format: 'json' or 'markdown' (default: 'markdown')

Query interpretation: - "weekly options" → dte=7 - "monthly options" → dte=30 - "around Dec 15" or "near December 20" → target_date="2024-12-15", target_date="2024-12-20" - "3 expirations around..." → limit=3 with dte or target_date - For multiple time periods (weekly, monthly, quarterly): Use dte with limit, NOT separate calls Example: "compare weekly, monthly, quarterly" → dte=30, limit=3 (gets ~weekly, ~monthly, ~next monthly in ONE call) - "what options are available" → option_type="both" - "what expiration dates" or "what dates are available" → fields=["expiration_dates"] - "activity summary", "options activity", "market sentiment", or any query with "summary" → summary=True - "liquid/active options" (without "summary") → add min_volume and min_open_interest (NOT summary=True) - Don't add filters unless specifically requested

Returns: Options chain data with contract details, prices, volume, open interest, and implied volatility. If fields=["expiration_dates"], returns only the list of expiration dates. If summary=True, returns aggregate statistics for market analysis. If limit > 1, returns data for multiple expirations.

Examples: yfinance_get_options_chain("SPY", fields=["expiration_dates"]) # Just get available expiration dates yfinance_get_options_chain("SPY", dte=7) # Weekly options (closest to 7 days) yfinance_get_options_chain("SPY", dte=7, summary=True) # Weekly options activity summary yfinance_get_options_chain("SPY", dte=30, limit=3) # Get 3 expirations around 30 days (detailed contracts) yfinance_get_options_chain("TSLA", dte=30, limit=3, summary=True, option_type="both") # Compare activity across 3 expirations yfinance_get_options_chain("AAPL", dte=30, limit=3, fields=["expiration_dates"]) # Get 3 expiration dates around 30 days yfinance_get_options_chain("AAPL", target_date="2024-12-15", limit=2) # 2 closest expirations to Dec 15 (detailed) yfinance_get_options_chain("TSLA", dte=7, min_volume=1000) # Liquid weekly options

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A3.9/5.0

Scored across 9 tools

Disambiguation4/5

Each tool maps to a distinct data product (quotes, profile, history, financials, recommendations, news, search, earnings, options), so misselection is unlikely. The only mild overlap is current price data appearing in both yfinance_get_multiple_quotes and yfinance_get_stock_info, but the multi-ticker vs single-ticker comprehensive profile distinction is clear enough.

Naming Consistency5/5

All nine tools follow a uniform `yfinance_verb_noun` snake_case pattern (get_stock_info, get_stock_history, search_stocks, etc.). The shared prefix and consistent verb choice make the set highly predictable.

Tool Count5/5

Nine tools is well within the sweet spot and each one covers a genuinely different facet of equity research. No tool feels redundant or like a thin wrapper that could be folded into another.

Completeness4/5

Coverage is broad for the stated domain: quotes, fundamentals, statements, analyst ratings, news, search, earnings calendar, and options. Minor gaps exist for dividends/splits, institutional holders, and market-wide movers/trending, but core agent workflows are fully supported.

Maintenance

ActivityInactive
ResponsivenessNo recent community issues