Skip to main content
Glama
leoncuhk

MCP Yahoo Finance

by leoncuhk

get_cashflow

Retrieve cash flow statements for stocks to analyze financial health and liquidity. Specify symbol and frequency (yearly, quarterly) for detailed cash flow data.

Instructions

Get cashflow for a given stock symbol.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYesStock symbol in Yahoo Finance format.
freqNoAt what frequency to get cashflow statements. Defaults to "yearly". Valid freqencies: "yearly", "quarterly", "trainling"

Implementation Reference

  • MCP tool handler function for get_cashflow, registered via @mcp_instance.tool() decorator, delegates to YahooFinance.get_cashflow
    @mcp_instance.tool()
    def get_cashflow(
        symbol: str, freq: Literal["yearly", "quarterly", "trainling"] = "yearly"
    ) -> str:
        """Get cashflow for a given stock symbol.
    
        Args:
            symbol (str): Stock symbol in Yahoo Finance format.
            freq (str): At what frequency to get cashflow statements. Defaults to "yearly".
                    Valid freqencies: "yearly", "quarterly", "trainling"
        """
        # Note: Original function didn't specify return type, assuming str
        return str(yf_instance.get_cashflow(symbol, freq))
  • Supporting helper method in YahooFinance class that fetches and formats cashflow data using yfinance.
    def get_cashflow(
        self, symbol: str, freq: Literal["yearly", "quarterly", "trainling"] = "yearly"
    ):
        """Get cashflow for a given stock symbol.
    
        Args:
            symbol (str): Stock symbol in Yahoo Finance format.
            freq (str): At what frequency to get cashflow statements. Defaults to "yearly".
                    Valid freqencies: "yearly", "quarterly", "trainling"
        """
        stock = Ticker(ticker=symbol, session=self.session)
        cashflow = stock.get_cashflow(freq=freq, pretty=True)
    
        if isinstance(cashflow, pd.DataFrame):
            cashflow.columns = [str(col.date()) for col in cashflow.columns]
            return f"{cashflow.to_json(indent=2)}"
        return f"{cashflow}"
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 states the tool retrieves cashflow data but lacks details on rate limits, authentication needs, data freshness, error handling, or response format. For a tool with no annotations, this leaves significant gaps in understanding its operational behavior.

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 fluff. It's appropriately sized and front-loaded, making it easy to understand at a glance. Every word earns its place.

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 tools, no annotations, and no output schema, the description is insufficient. It doesn't explain what the cashflow data includes (e.g., operating, investing, financing activities), how it's formatted, or any limitations. For a tool with siblings offering related financial data, more context is needed to ensure proper use.

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 clear descriptions for both parameters (symbol and freq). The description adds no additional parameter semantics beyond what the schema provides, such as examples or edge cases. Since the schema does the heavy lifting, 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 tool's purpose: 'Get cashflow for a given stock symbol.' It specifies the verb ('Get') and resource ('cashflow'), and distinguishes it from siblings like get_income_statement or get_dividends by focusing on cashflow data. However, it doesn't explicitly differentiate from all siblings (e.g., it could mention it's for financial statements vs. price data).

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 scenarios like financial analysis, comparisons with other statements, or prerequisites. With siblings like get_income_statement and get_dividends, there's no indication of when cashflow data is preferred over other financial metrics.

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