Skip to main content
Glama
leoncuhk

MCP Yahoo Finance

by leoncuhk

get_news

Retrieve news articles for specific stock symbols to monitor market developments and company updates.

Instructions

Get news for a given stock symbol.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYesStock symbol in Yahoo Finance format.

Implementation Reference

  • The MCP tool handler for 'get_news'. Decorated with @mcp_instance.tool() to register and execute the tool, delegating to the YahooFinance instance's get_news method.
    @mcp_instance.tool() def get_news(symbol: str) -> str: """Get news for a given stock symbol. Args: symbol (str): Stock symbol in Yahoo Finance format. """ return yf_instance.get_news(symbol)
  • Core helper method in the YahooFinance class that fetches the news for the given stock symbol using yfinance.Ticker and returns it as a JSON string.
    def get_news(self, symbol: str) -> str: """Get news for a given stock symbol. Args: symbol (str): Stock symbol in Yahoo Finance format. """ stock = Ticker(ticker=symbol, session=self.session) return json.dumps(stock.news, indent=2)

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