Skip to main content
Glama
marckwei

MCP Yahoo Finance

by marckwei

get_news

Retrieve financial news articles for specific stock symbols using Yahoo Finance data to support investment research and market analysis.

Instructions

Get news for a given stock symbol.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYesStock symbol in Yahoo Finance format.

Implementation Reference

  • The core implementation of the 'get_news' tool handler in the YahooFinance class. It creates a yfinance Ticker for the symbol and returns the news as formatted JSON.
    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)
  • Registration of the 'get_news' tool (line with generate_tool(yf.get_news)) in the MCP Server's list_tools method. The generate_tool utility auto-generates the tool schema from the function's signature and docstring.
    @server.list_tools()
    async def list_tools() -> list[Tool]:
        return [            
            generate_tool(yf.cmd_run),
            generate_tool(yf.get_recommendations),
            generate_tool(yf.get_news),
            generate_tool(yf.get_current_stock_price),
            generate_tool(yf.get_stock_price_by_date),
            generate_tool(yf.get_stock_price_date_range),
            generate_tool(yf.get_historical_stock_prices),
            generate_tool(yf.get_dividends),
            generate_tool(yf.get_income_statement),
            generate_tool(yf.get_cashflow),
            generate_tool(yf.get_earning_dates),
        ]
  • Dispatch handler in the MCP Server's call_tool method that executes the get_news tool by calling yf.get_news with arguments and wrapping the result in TextContent.
    case "get_news":
        price = yf.get_news(**args)
        return [TextContent(type="text", text=price)]
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It only states what the tool does without any details on traits like rate limits, data freshness, error handling, or output format. This is a significant gap for a tool that likely fetches external data, making it inadequate for informed usage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without any unnecessary words. It's front-loaded and appropriately sized for a simple tool, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (fetching news data) and lack of annotations and output schema, the description is incomplete. It doesn't explain what 'news' entails (e.g., headlines, articles, dates), potential limitations, or how results are returned. This leaves gaps for an AI agent to use the tool effectively.

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?

The description adds minimal meaning beyond the input schema, which has 100% coverage and clearly documents the 'symbol' parameter. The description implies the parameter is used to fetch news, but it doesn't provide additional context, such as examples of valid symbols or how the symbol maps to news sources. With high schema coverage, the baseline is 3.

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?

The description clearly states the tool's purpose with a specific verb ('Get') and resource ('news for a given stock symbol'), making it immediately understandable. However, it doesn't distinguish this tool from potential sibling tools that might also retrieve news-related data, such as if there were a 'get_market_news' or 'get_company_news' tool, which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention any context, prerequisites, or exclusions, such as whether it's for recent news, historical news, or specific sources. Given the sibling tools include various financial data tools, there's no indication of how this fits among them.

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

Install Server

Other 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/marckwei/no-use-tools'

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