Skip to main content
Glama
leoncuhk

MCP Yahoo Finance

by leoncuhk

get_dividends

Retrieve dividend information for a specific stock symbol to analyze income potential and track payout history.

Instructions

Get dividends for a given stock symbol.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYesStock symbol in Yahoo Finance format.

Implementation Reference

  • The MCP tool handler for get_dividends. Registered via FastMCP @tool decorator. Executes by delegating to the YahooFinance class method.
    @mcp_instance.tool()
    def get_dividends(symbol: str) -> str:
        """Get dividends for a given stock symbol.
    
        Args:
            symbol (str): Stock symbol in Yahoo Finance format.
        """
        return yf_instance.get_dividends(symbol)
  • Core implementation of get_dividends in YahooFinance class using yfinance.Ticker to fetch and format dividends as JSON.
    def get_dividends(self, symbol: str) -> str:
        """Get dividends for a given stock symbol.
    
        Args:
            symbol (str): Stock symbol in Yahoo Finance format.
        """
        stock = Ticker(ticker=symbol, session=self.session)
        dividends = stock.dividends
    
        if hasattr(dividends.index, "date"):
            dividends.index = dividends.index.date.astype(str)  # type: ignore
        return f"{dividends.to_json(orient='index')}"
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states what the tool does but doesn't add any behavioral traits beyond that—such as whether it's a read-only operation, potential rate limits, authentication needs, error handling, or the format of returned data. This leaves significant gaps in understanding how the tool behaves in practice.

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 extremely concise and front-loaded, consisting of a single sentence that directly states the tool's purpose. There is no wasted language or unnecessary elaboration, making it efficient and easy to parse for an AI agent.

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 complexity of financial data retrieval, lack of annotations, and no output schema, the description is incomplete. It doesn't explain what 'dividends' entail (e.g., historical dividends, upcoming dividends, dividend yields), the return format, or any limitations. This leaves the agent with insufficient context to use the tool effectively beyond the basic parameter.

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 schema description coverage is 100%, with the single parameter 'symbol' fully documented in the schema as 'Stock symbol in Yahoo Finance format.' The description adds no additional meaning beyond this, as it only repeats the need for a stock symbol without providing extra context or semantics. With high schema coverage, the baseline score of 3 is appropriate.

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 action ('Get dividends') and the target resource ('for a given stock symbol'), which provides a specific verb+resource combination. However, it doesn't differentiate this tool from its siblings (like get_earning_dates or get_historical_stock_prices), which also retrieve financial data for stock symbols, so it doesn't fully distinguish its specific purpose within the family of tools.

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 prerequisites, exclusions, or compare it to sibling tools (e.g., get_earning_dates for earnings data or get_historical_stock_prices for price history), leaving the agent with no context for selection among similar financial data retrieval tools.

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/leoncuhk/mcp-yahoo-finance'

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