Skip to main content
Glama
yfinance-ai MCP server

yfinance-ai MCP server

by lkcair

yfinance-ai MCP server

PyPI License: MIT

World's first AI-powered Yahoo Finance integration: 68 tools for stocks, ETFs, mutual funds, crypto, forex and commodities, in one Python file.

🚀 Thousands of downloads on ClawHub and OpenWebUI

Prices and history, financial statements, ratios and valuation history, analyst estimates and price targets, earnings, dividends, options, holders and insiders, funds and ETFs, market movers, sectors and industries, and earnings, IPO, economic and split calendars.

Use it in

Install

Repo

Claude, Cursor, VS Code, LangChain, Google ADK, Strands Agents and other MCP clients

uvx yfinance-ai@latest

yfinance-ai-mcp

ClawHub skill for OpenClaw 🚀 Thousands of downloads

openclaw skills install @lkcair/stocks

yfinance-ai-skill

OpenWebUI tool 🚀 Thousands of downloads

Get it on openwebui.com

yfinance-ai

Python

from yfinance_ai import Tools

yfinance-ai

Install

Needs uv. No API key.

Claude Code:

claude mcp add yfinance-ai -- uvx yfinance-ai@latest

VS Code:

code --add-mcp '{"name":"yfinance-ai","type":"stdio","command":"uvx","args":["yfinance-ai@latest"]}'

Claude Desktop, Cursor, Windsurf and other clients, in the client's MCP config file:

{
  "mcpServers": {
    "yfinance-ai": {
      "command": "uvx",
      "args": [
        "yfinance-ai@latest"
      ]
    }
  }
}

@latest picks up new releases when the client starts. Without uv: pip install yfinance-ai, then use "command": "yfinance-ai" with no args.

Listed in the MCP Registry as io.github.lkcair/yfinance-ai. Every tool is read-only.

Related MCP server: Yahoo Finance MCP Server

Agent frameworks

The server runs over stdio with uvx yfinance-ai@latest, so any framework with MCP support can load all its tools.

LangChain: pip install "langchain[mcp]" langchain-anthropic

import asyncio
from langchain.agents import create_agent
from langchain.mcp import MCPAdapter

async def main():
    config = {"mcpServers": {"yfinance-ai": {
        "command": "uvx", "args": ["yfinance-ai@latest"],
    }}}
    async with MCPAdapter(config) as adapter:
        tools = await adapter.list_tools()
        agent = create_agent("claude-sonnet-5", tools)
        result = await agent.ainvoke({"messages": [{"role": "user", "content": "What is Apple's P/E, and how does it compare with Microsoft and Google?"}]})
        print(result["messages"][-1].content)

asyncio.run(main())

Google ADK: pip install "google-adk[mcp]"

from google.adk.agents import LlmAgent
from google.adk.tools.mcp_tool import McpToolset
from google.adk.tools.mcp_tool.mcp_session_manager import StdioConnectionParams
from mcp import StdioServerParameters

root_agent = LlmAgent(
    model="gemini-flash-latest",
    name="yfinance_ai",
    instruction="Answer with the yfinance-ai tools.",
    tools=[McpToolset(connection_params=StdioConnectionParams(
        server_params=StdioServerParameters(command="uvx", args=["yfinance-ai@latest"]),
        timeout=60,
    ))],
)

Strands Agents: pip install strands-agents

from mcp import stdio_client, StdioServerParameters
from strands import Agent
from strands.tools.mcp import MCPClient

yfinance_ai = MCPClient(lambda: stdio_client(StdioServerParameters(
    command="uvx", args=["yfinance-ai@latest"],
)))
agent = Agent(tools=[yfinance_ai])
agent("What is Apple's P/E, and how does it compare with Microsoft and Google?")

Example questions

  • What is Apple's P/E, and how does it compare with Microsoft and Google?

  • What are analysts saying about NVIDIA? Price targets and recent upgrades.

  • Who reports earnings this week?

  • Bitcoin price, EUR/USD rate and gold today.

MCP tools (68)

Quotes and history

Tool

Parameters

Description

get_stock_price

ticker

Get current stock price and key metrics for a ticker symbol

get_stock_quote

ticker

Get detailed quote with bid/ask, day range, and trading info

get_fast_info

ticker

Get fast-access ticker information (lightweight, quick response)

get_historical_data

ticker, period="1y", interval="1d"

Get historical price data for a stock

get_historical_price_on_date

ticker, date

Get historical price for a specific date

download_multiple_tickers

tickers, period="1mo", interval="1d"

Historical data for several tickers at once

Company

Tool

Parameters

Description

get_company_info

ticker

Get detailed company information and business description

get_company_overview

ticker

Company overview with context for every metric

get_company_officers

ticker

Get company officers and key management

get_isin

ticker

Get International Securities Identification Number (ISIN) for a ticker

Financials

Tool

Parameters

Description

get_income_statement

ticker, period="annual"

Get income statement data

get_balance_sheet

ticker, period="annual"

Get balance sheet data

get_cash_flow

ticker, period="annual"

Get cash flow statement data

get_ttm_financials

ticker

Get trailing-twelve-month (TTM) income statement and cash flow

get_key_ratios

ticker

Get key financial ratios and valuation metrics

get_valuation_history

ticker

Get valuation measures now and for the last quarters (market cap, EV, P/E, PEG, P/S, P/B, EV/EBITDA)

get_financial_summary

ticker

Get a comprehensive one-page financial summary of a stock

get_shares_history

ticker, years=3

Get shares outstanding over time (dilution or buybacks)

Earnings and estimates

Tool

Parameters

Description

get_earnings_dates

ticker

Get upcoming and past earnings dates with estimates

get_earnings_history

ticker

Get historical earnings data with annual and quarterly figures

get_earnings_calendar

ticker

Get earnings calendar including next earnings date and dividend dates

get_analyst_estimates

ticker

Get analyst estimates for earnings, revenue, and EPS

get_growth_estimates

ticker

Get analyst growth estimates

get_eps_trend

ticker

Get EPS (Earnings Per Share) trend data showing how estimates have changed

get_eps_revisions

ticker

Get EPS revision data showing analyst estimate changes

Analysts

Tool

Parameters

Description

get_analyst_recommendations

ticker

Get analyst recommendations and ratings

get_analyst_price_targets

ticker

Get detailed analyst price targets for a stock

get_upgrades_downgrades

ticker, limit=20

Get detailed analyst upgrades and downgrades history

Holders and insiders

Tool

Parameters

Description

get_institutional_holders

ticker

Get major institutional holders and their ownership

get_major_holders

ticker

Get major holders summary (institutions, insiders, public float)

get_mutualfund_holders

ticker

Get mutual fund holders

get_insider_transactions

ticker

Get recent insider trading activity

get_insider_purchases

ticker

Get insider purchases only (filtered for buys)

get_insider_roster_holders

ticker

Get insider roster (list of company insiders)

Dividends and corporate actions

Tool

Parameters

Description

get_dividends

ticker, period="5y"

Get dividend payment history and current metrics

get_stock_splits

ticker

Get stock split history

get_corporate_actions

ticker

Get all corporate actions (dividends + splits combined)

get_capital_gains

ticker

Get capital gains distributions (primarily for funds/ETFs)

Options

Tool

Parameters

Description

get_options_chain

ticker, expiration=""

Get options chain data (calls and puts)

get_options_expirations

ticker

Get all available options expiration dates

Market-wide

Tool

Parameters

Description

get_market_status

Check if US stock markets are currently open

get_market_summary

region="US"

Get a market overview for a region: open/closed status plus main indices, futures, bonds and FX

get_market_indices

Get current prices for major market indices

get_market_movers

category="day_gainers", count=10

Get today's market movers from Yahoo Finance screeners

get_trending_tickers

count=10

Get today's most active (trending) US tickers

get_sector_performance

Get performance of major market sectors

get_sector_overview

sector="technology"

Get a sector overview: size, weight, largest companies, industries and sector ETFs

get_industry_overview

industry="semiconductors"

Get an industry overview: largest, best-performing and fastest-growing companies

Calendars

Tool

Parameters

Description

get_upcoming_earnings

days=7, limit=25

Get the market-wide earnings calendar (which companies report in the next N days)

get_ipo_calendar

days=14, limit=25

Get upcoming IPOs (exchange, expected date, price range, shares)

get_economic_calendar

days=7, limit=30

Get upcoming economic events (CPI, jobs, GDP, rate decisions) with expected and prior values

get_splits_calendar

days=14, limit=25

Get upcoming stock splits

Funds and ETFs

Tool

Parameters

Description

get_fund_overview

ticker

Get overview data for an ETF or mutual fund

get_fund_holdings

ticker, limit=25

Get top holdings for an ETF or mutual fund

get_fund_sector_weights

ticker

Get sector allocation/weights for an ETF or mutual fund

Crypto, forex and commodities

Tool

Parameters

Description

get_crypto_price

symbol

Get cryptocurrency price and market data

get_forex_rate

pair

Get foreign exchange (forex) rate for a currency pair

get_commodity_price

commodity

Get commodity/futures price data

Compare

Tool

Parameters

Description

compare_stocks

tickers

Compare key metrics across multiple stocks

get_peer_comparison

ticker, peers=null

Compare a stock with its peers on key metrics

get_historical_comparison

tickers, period="1y"

Compare historical price performance of multiple stocks

get_complete_analysis

ticker, peers=""

Complete analysis of a stock, calling every relevant tool

News and filings

Tool

Parameters

Description

get_stock_news

ticker, limit=10

Get recent news articles about a stock

get_sec_filings

ticker

Get recent SEC filings (10-K, 10-Q, 8-K, etc.)

Utility

Tool

Parameters

Description

search_ticker

query

Search for ticker symbols by company name or keyword

validate_ticker

ticker

Validate if a ticker symbol exists and is tradeable

get_api_status

Get API status and usage information

run_self_test

ticker="SPY"

Run comprehensive self-test of the yfinance-ai tools (64 checks)

License

MIT. Data comes from Yahoo Finance through yfinance and may be delayed. Not affiliated with Yahoo. For research and education, not investment advice.

Available Tools

68 tools
compare_stocksB
Read-onlyIdempotent

Compare key metrics across multiple stocks.

Args: tickers: Comma-separated list of ticker symbols (e.g., 'AAPL,MSFT,GOOGL')

Returns: Comparison table of price, market cap, P/E, dividend yield, and returns

Inputs: tickers (required). Returns: result

download_multiple_tickersB
Read-onlyIdempotent

Download historical data for multiple tickers at once (bulk operation).

Args: tickers: Space or comma-separated ticker symbols (e.g., 'AAPL MSFT GOOGL') period: Time period (default: 1mo) interval: Data interval (default: 1d)

Returns: Summary of downloaded data for all tickers

Inputs: tickers (required), period, interval. Returns: result

get_analyst_estimatesB
Read-onlyIdempotent

Get analyst estimates for earnings, revenue, and EPS.

Args: ticker: Stock ticker symbol

Returns: Comprehensive analyst estimates and forecasts

Inputs: ticker (required). Returns: result

get_analyst_price_targetsB
Read-onlyIdempotent

Get detailed analyst price targets for a stock.

Args: ticker: Stock ticker symbol

Returns: Comprehensive price target data including current, low, mean, median, high targets and the number of analysts covering the stock

Inputs: ticker (required). Returns: result

get_analyst_recommendationsB
Read-onlyIdempotent

Get analyst recommendations and ratings.

Args: ticker: Stock ticker symbol

Returns: Analyst buy/hold/sell recommendations, consensus, and recent upgrades/downgrades

Inputs: ticker (required). Returns: result

get_api_statusB
Read-onlyIdempotent

Get API status and usage information.

Returns: Current API usage statistics and configuration

Inputs: no named parameters. Returns: result

get_balance_sheetB
Read-onlyIdempotent

Get balance sheet data.

Args: ticker: Stock ticker symbol period: 'annual' or 'quarterly'

Returns: Balance sheet with assets, liabilities, and equity

Inputs: ticker (required), period. Returns: result

get_capital_gainsA
Read-onlyIdempotent

Get capital gains distributions (primarily for funds/ETFs).

Args: ticker: Ticker symbol (typically ETF or mutual fund)

Returns: Capital gains distribution history

Inputs: ticker (required). Returns: result

get_cash_flowA
Read-onlyIdempotent

Get cash flow statement data.

Args: ticker: Stock ticker symbol period: 'annual' or 'quarterly'

Returns: Cash flow statement with operating, investing, and financing activities

Inputs: ticker (required), period. Returns: result

get_commodity_priceA
Read-onlyIdempotent

Get commodity/futures price data.

Args: commodity: Commodity name or ticker (e.g., 'gold', 'oil', 'crude oil', 'GC=F', 'CL=F')

Returns: Current price, day change, and key market data

Inputs: commodity (required). Returns: result

get_company_infoB
Read-onlyIdempotent

Get detailed company information and business description.

Args: ticker: Stock ticker symbol

Returns: Company overview including sector, industry, employees, website, and business summary

Inputs: ticker (required). Returns: result

get_company_officersB
Read-onlyIdempotent

Get company officers and key management.

Args: ticker: Stock ticker symbol

Returns: List of company officers with titles and compensation

Inputs: ticker (required). Returns: result

get_company_overviewB
Read-onlyIdempotent

Get a beautiful, insightful company overview with context for every metric. Perfect for quick overviews and basic questions about a company.

Args: ticker: Stock ticker symbol (e.g., 'AAPL', 'MSFT')

Returns: Beautifully formatted company overview with insights and context

Inputs: ticker (required). Returns: result

get_complete_analysisA
Read-onlyIdempotent

Run a complete analysis of a stock by calling ALL available functions. This is the most comprehensive analysis available - use when user asks for "everything about" or "complete analysis of" a company.

Args: ticker: Stock ticker symbol (e.g., 'AAPL', 'MSFT') peers: Optional comma-separated peer tickers for comparison (e.g., 'MSFT,GOOGL,META') AI should provide contextually relevant peers based on the conversation.

Returns: Comprehensive analysis with results from all applicable functions

Inputs: ticker (required), peers. Returns: result

get_corporate_actionsA
Read-onlyIdempotent

Get all corporate actions (dividends + splits combined).

Args: ticker: Stock ticker symbol

Returns: Combined history of dividends and stock splits

Inputs: ticker (required). Returns: result

get_crypto_priceA
Read-onlyIdempotent

Get cryptocurrency price and market data.

Args: symbol: Crypto symbol (e.g., 'BTC', 'ETH', 'bitcoin', 'ethereum', 'BTC-USD')

Returns: Current price, 24h change, market cap, volume, and key metrics

Inputs: symbol (required). Returns: result

get_dividendsA
Read-onlyIdempotent

Get dividend payment history and current metrics.

Args: ticker: Stock ticker symbol period: Time period for dividend history (1y, 5y, 10y, max)

Returns: Dividend history and current dividend metrics

Inputs: ticker (required), period. Returns: result

get_earnings_calendarB
Read-onlyIdempotent

Get earnings calendar including next earnings date and dividend dates.

Args: ticker: Stock ticker symbol

Returns: Upcoming earnings dates, ex-dividend dates, and dividend payment dates

Inputs: ticker (required). Returns: result

get_earnings_datesC
Read-onlyIdempotent

Get upcoming and past earnings dates with estimates.

Args: ticker: Stock ticker symbol

Returns: Earnings calendar with dates, estimates, and actual results

Inputs: ticker (required). Returns: result

get_earnings_historyB
Read-onlyIdempotent

Get historical earnings data with annual and quarterly figures.

Args: ticker: Stock ticker symbol

Returns: Historical earnings by year and quarter

Inputs: ticker (required). Returns: result

get_economic_calendarA
Read-onlyIdempotent

Get upcoming economic events (CPI, jobs, GDP, rate decisions) with expected and prior values.

Args: days: Look-ahead window in days (default 7) limit: Max events (default 30)

Returns: Table of economic events by region and time

Inputs: days, limit. Returns: result

get_eps_revisionsC
Read-onlyIdempotent

Get EPS revision data showing analyst estimate changes.

Args: ticker: Stock ticker symbol

Returns: EPS revisions showing up/down estimate changes by analysts

Inputs: ticker (required). Returns: result

get_eps_trendB
Read-onlyIdempotent

Get EPS (Earnings Per Share) trend data showing how estimates have changed.

Args: ticker: Stock ticker symbol

Returns: EPS trend data showing estimate changes over different time periods

Inputs: ticker (required). Returns: result

get_fast_infoA
Read-onlyIdempotent

Get fast-access ticker information (lightweight, quick response).

Args: ticker: Stock ticker symbol

Returns: Quick summary with most recent price, market cap, and basic metrics

Example: Useful for quick price checks without full info loading.

Inputs: ticker (required). Returns: result

get_financial_summaryC
Read-onlyIdempotent

Get a comprehensive one-page financial summary of a stock.

Args: ticker: Stock ticker symbol

Returns: Comprehensive summary including price, valuation, financials, and analyst data

Inputs: ticker (required). Returns: result

get_forex_rateA
Read-onlyIdempotent

Get foreign exchange (forex) rate for a currency pair.

Args: pair: Currency pair (e.g., 'EURUSD', 'EUR/USD', 'eurusd', 'GBPUSD=X')

Returns: Current exchange rate, bid/ask, day range, and recent changes

Inputs: pair (required). Returns: result

get_fund_holdingsA
Read-onlyIdempotent

Get top holdings for an ETF or mutual fund.

Args: ticker: Fund ticker symbol (e.g., 'VOO', 'SPY', 'QQQ') limit: Maximum number of holdings to return (default 25)

Returns: List of top holdings with weights and values

Inputs: ticker (required), limit. Returns: result

get_fund_overviewA
Read-onlyIdempotent

Get overview data for an ETF or mutual fund.

Args: ticker: Fund ticker symbol (e.g., 'VOO', 'SPY', 'QQQ', 'ARKK')

Returns: Fund category, family, total assets, expense ratio, and other key metrics

Inputs: ticker (required). Returns: result

get_fund_sector_weightsB
Read-onlyIdempotent

Get sector allocation/weights for an ETF or mutual fund.

Args: ticker: Fund ticker symbol (e.g., 'VOO', 'SPY', 'QQQ')

Returns: Sector allocation percentages for the fund

Inputs: ticker (required). Returns: result

get_growth_estimatesB
Read-onlyIdempotent

Get analyst growth estimates.

Args: ticker: Stock ticker symbol

Returns: Growth rate estimates for various periods

Inputs: ticker (required). Returns: result

get_historical_comparisonB
Read-onlyIdempotent

Compare historical price performance of multiple stocks.

Args: tickers: Comma or space-separated ticker symbols (e.g., 'AAPL,MSFT,GOOGL') period: Time period for comparison (default: 1y)

Returns: Performance comparison showing % returns for each ticker

Inputs: tickers (required), period. Returns: result

get_historical_dataA
Read-onlyIdempotent

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")

Inputs: ticker (required), period, interval. Returns: result

get_historical_price_on_dateA
Read-onlyIdempotent

Get historical price for a specific date.

Args: ticker: Stock ticker symbol date: Date in YYYY-MM-DD format (e.g., "2024-01-15")

Returns: Price on that date (or closest trading day)

Example: >>> await get_historical_price_on_date("AAPL", "2024-01-15")

Inputs: date (required), ticker (required). Returns: result

get_income_statementB
Read-onlyIdempotent

Get income statement data.

Args: ticker: Stock ticker symbol period: 'annual', 'quarterly', or 'ttm' (trailing twelve months)

Returns: Income statement with revenue, expenses, and net income

Inputs: ticker (required), period. Returns: result

get_industry_overviewA
Read-onlyIdempotent

Get an industry overview: largest, best-performing and fastest-growing companies.

Args: industry: Industry key, e.g. semiconductors, software-infrastructure, biotechnology, banks-regional, oil-gas-integrated (see get_sector_overview for all keys)

Returns: Industry summary with top companies by size, YTD performance and growth

Inputs: industry. Returns: result

get_insider_purchasesA
Read-onlyIdempotent

Get insider purchases only (filtered for buys).

Args: ticker: Stock ticker symbol

Returns: Recent insider purchase transactions

Inputs: ticker (required). Returns: result

get_insider_roster_holdersB
Read-onlyIdempotent

Get insider roster (list of company insiders).

Args: ticker: Stock ticker symbol

Returns: List of company insiders and their positions

Inputs: ticker (required). Returns: result

get_insider_transactionsB
Read-onlyIdempotent

Get recent insider trading activity.

Args: ticker: Stock ticker symbol

Returns: Recent insider buy/sell transactions

Inputs: ticker (required). Returns: result

get_institutional_holdersB
Read-onlyIdempotent

Get major institutional holders and their ownership.

Args: ticker: Stock ticker symbol

Returns: List of institutional holders with shares owned and percentage ownership

Inputs: ticker (required). Returns: result

get_ipo_calendarB
Read-onlyIdempotent

Get upcoming IPOs (exchange, expected date, price range, shares).

Args: days: Look-ahead window in days (default 14) limit: Max IPOs (default 25)

Returns: Table of upcoming IPOs

Inputs: days, limit. Returns: result

get_isinC
Read-onlyIdempotent

Get International Securities Identification Number (ISIN) for a ticker.

Args: ticker: Stock ticker symbol

Returns: ISIN code and related identification information

Inputs: ticker (required). Returns: result

get_key_ratiosB
Read-onlyIdempotent

Get key financial ratios and valuation metrics.

Args: ticker: Stock ticker symbol

Returns: Comprehensive ratios including P/E, P/B, ROE, ROA, profit margins, debt ratios

Inputs: ticker (required). Returns: result

get_major_holdersB
Read-onlyIdempotent

Get major holders summary (institutions, insiders, public float).

Args: ticker: Stock ticker symbol

Returns: Summary of insider vs institutional ownership percentages

Inputs: ticker (required). Returns: result

get_market_indicesB
Read-onlyIdempotent

Get current prices for major market indices.

Returns: Current values and changes for S&P 500, Nasdaq, Dow Jones, and other major indices

Inputs: no named parameters. Returns: result

get_market_moversA
Read-onlyIdempotent

Get today's market movers from Yahoo Finance screeners.

Args: category: day_gainers, day_losers, most_actives, most_shorted_stocks, small_cap_gainers, undervalued_large_caps, undervalued_growth_stocks, growth_technology_stocks, aggressive_small_caps, top_etfs_us, top_performing_etfs, technology_etfs, bond_etfs, top_mutual_funds count: Number of results (1-50, default 10)

Returns: Table of tickers with price, change %, volume and market cap

Inputs: count, category. Returns: result

get_market_statusA
Read-onlyIdempotent

Check if US stock markets are currently open.

Returns: Market status (open/closed), current time, and market hours

Inputs: no named parameters. Returns: result

get_market_summaryA
Read-onlyIdempotent

Get a market overview for a region: open/closed status plus main indices, futures, bonds and FX.

Args: region: US, GB, DE, FR, JP, HK, IN, CA, AU, BR, EUROPE, ASIA (default US)

Returns: Market status and a table of the region's headline instruments

Inputs: region. Returns: result

get_mutualfund_holdersB
Read-onlyIdempotent

Get mutual fund holders.

Args: ticker: Stock ticker symbol

Returns: List of mutual funds holding the stock

Inputs: ticker (required). Returns: result

get_options_chainA
Read-onlyIdempotent

Get options chain data (calls and puts).

Args: ticker: Stock ticker symbol expiration: Specific expiration date (YYYY-MM-DD) or empty for nearest

Returns: Options chain with top calls and puts by volume

Inputs: ticker (required), expiration. Returns: result

get_options_expirationsB
Read-onlyIdempotent

Get all available options expiration dates.

Args: ticker: Stock ticker symbol

Returns: List of all available options expiration dates

Inputs: ticker (required). Returns: result

get_peer_comparisonB
Read-onlyIdempotent

Compare a stock with its peers on key metrics.

Args: ticker: Primary stock ticker symbol peers: Optional comma-separated peer tickers (if not provided, uses sector peers)

Returns: Comparison table of key metrics across stocks

Inputs: ticker (required), peers. Returns: result

get_sec_filingsC
Read-onlyIdempotent

Get recent SEC filings (10-K, 10-Q, 8-K, etc.).

Args: ticker: Stock ticker symbol

Returns: Recent SEC filings with types and dates

Inputs: ticker (required). Returns: result

get_sector_overviewA
Read-onlyIdempotent

Get a sector overview: size, weight, largest companies, industries and sector ETFs.

Args: sector: basic-materials, communication-services, consumer-cyclical, consumer-defensive, energy, financial-services, healthcare, industrials, real-estate, technology, utilities

Returns: Sector summary with top companies and its industries

Inputs: sector. Returns: result

get_sector_performanceB
Read-onlyIdempotent

Get performance of major market sectors.

Returns: Performance data for major S&P 500 sectors

Inputs: no named parameters. Returns: result

get_shares_historyA
Read-onlyIdempotent

Get shares outstanding over time (dilution or buybacks).

Args: ticker: Stock ticker symbol years: How many years back (default 3)

Returns: Shares outstanding at several points and the total change

Inputs: ticker (required), years. Returns: result

get_splits_calendarB
Read-onlyIdempotent

Get upcoming stock splits.

Args: days: Look-ahead window in days (default 14) limit: Max splits (default 25)

Returns: Table of upcoming splits with ratios

Inputs: days, limit. Returns: result

get_stock_newsA
Read-onlyIdempotent

Get recent news articles about a stock.

Args: ticker: Stock ticker symbol limit: Maximum number of news articles to return (default 10)

Returns: Recent news headlines, sources, and links

Inputs: ticker (required), limit. Returns: result

get_stock_priceB
Read-onlyIdempotent

Get current stock price and key metrics for a ticker symbol.

Args: ticker: Stock ticker symbol (e.g., 'AAPL', 'TSLA', 'SPY')

Returns: Formatted string with current price, market cap, P/E ratio, and other key metrics

Example: >>> await get_stock_price("AAPL") AAPL - Apple Inc. Current Price: $175.43 Market Cap: $2.75T ...

Inputs: ticker (required). Returns: result

get_stock_quoteB
Read-onlyIdempotent

Get detailed quote with bid/ask, day range, and trading info.

Args: ticker: Stock ticker symbol

Returns: Detailed quote information including bid/ask spreads and intraday trading data

Inputs: ticker (required). Returns: result

get_stock_splitsB
Read-onlyIdempotent

Get stock split history.

Args: ticker: Stock ticker symbol

Returns: Complete stock split history with dates and ratios

Inputs: ticker (required). Returns: result

get_ttm_financialsB
Read-onlyIdempotent

Get trailing-twelve-month (TTM) income statement and cash flow.

Args: ticker: Stock ticker symbol

Returns: Key TTM lines: revenue, gross profit, operating income, net income, EBITDA, EPS, cash flows

Inputs: ticker (required). Returns: result

get_upcoming_earningsA
Read-onlyIdempotent

Get the market-wide earnings calendar (which companies report in the next N days).

Args: days: Look-ahead window in days (default 7) limit: Max companies (default 25)

Returns: Companies with report date, timing and EPS estimate

Inputs: days, limit. Returns: result

get_upgrades_downgradesB
Read-onlyIdempotent

Get detailed analyst upgrades and downgrades history.

Args: ticker: Stock ticker symbol limit: Maximum number of rating changes to return (default 20)

Returns: Recent analyst rating changes including firm, action, and grade changes

Inputs: ticker (required), limit. Returns: result

get_valuation_historyB
Read-onlyIdempotent

Get valuation measures now and for the last quarters (market cap, EV, P/E, PEG, P/S, P/B, EV/EBITDA).

Args: ticker: Stock ticker symbol

Returns: Table of valuation measures by quarter

Inputs: ticker (required). Returns: result

run_self_testA
Read-onlyIdempotent

Run comprehensive self-test of the yfinance-ai tools (64 checks).

This function is designed to be called by AI assistants to verify that all tools are working correctly. It tests each tool category, reports success/failure status, and shows sample data from each test.

Args: ticker: Ticker symbol to use for testing (default: SPY - reliable ETF with full data)

Returns: Comprehensive test report with pass/fail status and sample data for all tools

Example AI Prompt: "Run self-test on yfinance tools" "Test all financial data functions" "Verify yfinance-ai is working"

Inputs: ticker. Returns: result

search_tickerB
Read-onlyIdempotent

Search for ticker symbols by company name or keyword.

Args: query: Company name or keyword to search

Returns: List of matching tickers

Inputs: query (required). Returns: result

validate_tickerC
Read-onlyIdempotent

Validate if a ticker symbol exists and is tradeable.

Args: ticker: Ticker symbol to validate

Returns: Validation result with ticker details if valid

Inputs: ticker (required). Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 68 tools

    Disambiguation2/5

    Many tools overlap heavily: get_stock_price/get_stock_quote/get_fast_info/get_company_overview/get_financial_summary/get_complete_analysis all serve quick company/price overviews, while compare_stocks/get_peer_comparison/get_historical_comparison and several earnings/analyst/holder tools have close boundaries. Descriptions help, but an agent can easily misselect among similar read-only financial-data endpoints.

    Naming Consistency4/5

    The set is overwhelmingly consistent with get_* snake_case names for data retrieval. A few outliers such as compare_stocks, download_multiple_tickers, search_ticker, validate_ticker, and run_self_test are minor deviations but still readable.

    Tool Count1/5

    With 68 tools, the surface is far beyond a well-scoped set and includes many redundant overview/quote/analyst/holder variants. The count is an extreme mismatch for practical tool selection despite the broad financial domain.

    Completeness4/5

    Coverage is extensive across quotes, fundamentals, analysts, earnings, funds, options, macro calendars, forex, crypto, commodities, and SEC filings. Some niche areas are missing or only indirectly covered, but the read-only market-data surface is broadly complete.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides real-time financial data from Yahoo Finance to Large Language Models through the Model Context Protocol, enabling AI models to access stock prices, historical data, and company information.
      1
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides comprehensive financial data from Yahoo Finance, enabling retrieval of stock prices, company information, financial statements, options data, analyst recommendations, and market news through natural language queries.
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides comprehensive access to Yahoo Finance data, including historical stock prices, financial statements, and analyst recommendations. It is designed for deployment on Cloudflare Workers and supports multiple transport methods to integrate market data into LLM workflows.
      94 npm
      MIT