Skip to main content
Glama
leoncuhk

MCP Yahoo Finance

by leoncuhk

get_earning_dates

Fetch upcoming and historical earning dates for a specific stock symbol using financial data. Input the stock symbol and optional limit to retrieve earnings dates.

Instructions

Get earning dates.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNomax amount of upcoming and recent earnings dates to return. Default value 12 should return next 4 quarters and last 8 quarters. Increase if more history is needed.
symbolYesStock symbol in Yahoo Finance format.

Implementation Reference

  • MCP tool handler and registration for 'get_earning_dates'. This decorated function serves as the entry point for the tool call, delegating to the YahooFinance instance.
    @mcp_instance.tool() def get_earning_dates(symbol: str, limit: int = 12) -> str: """Get earning dates. Args: symbol (str): Stock symbol in Yahoo Finance format. limit (int): max amount of upcoming and recent earnings dates to return. Default value 12 should return next 4 quarters and last 8 quarters. Increase if more history is needed. """ return yf_instance.get_earning_dates(symbol, limit)
  • Supporting method in YahooFinance class that fetches earnings dates using yfinance.Ticker.get_earnings_dates() and formats the response as JSON string.
    def get_earning_dates(self, symbol: str, limit: int = 12) -> str: """Get earning dates. Args: symbol (str): Stock symbol in Yahoo Finance format. limit (int): max amount of upcoming and recent earnings dates to return. Default value 12 should return next 4 quarters and last 8 quarters. Increase if more history is needed. """ stock = Ticker(ticker=symbol, session=self.session) earning_dates = stock.get_earnings_dates(limit=limit) if isinstance(earning_dates, pd.DataFrame): earning_dates.index = earning_dates.index.date.astype(str) # type: ignore return f"{earning_dates.to_json(indent=2)}" return f"{earning_dates}"

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/leoncuhk/mcp-yahoo-finance'

If you have feedback or need assistance with the MCP directory API, please join our Discord server