Skip to main content
Glama
16Coffee

Yahoo Finance MCP Server

by 16Coffee

get_dcf_valuation

Calculate discounted cash flow (DCF) or levered DCF valuations for stocks by inputting the valuation type and stock symbol. Access accurate financial valuation data via the Yahoo Finance MCP Server.

Instructions

获取 DCF 或杠杆 DCF 估值数据。

参数说明: valuation_type: str dcf 或 levered symbol: str 股票代码

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYes
valuation_typeYes

Implementation Reference

  • server.py:489-498 (registration)
    Registration of the 'get_dcf_valuation' tool using the @fmp_server.tool decorator, including name and description with parameter details.
    @fmp_server.tool(
        name="get_dcf_valuation",
        description="""获取 DCF 或杠杆 DCF 估值数据。
    
    参数说明:
        valuation_type: str
            dcf 或 levered
        symbol: str
            股票代码""",
    )
  • The main handler function that fetches DCF or levered DCF valuation data from the Financial Modeling Prep API based on the provided valuation_type and symbol.
    async def get_dcf_valuation(valuation_type: str, symbol: str) -> str:
        """根据类型获取 DCF 估值"""
    
        api_key = os.environ.get("FMP_API_KEY")
        if not api_key:
            return "Error: FMP_API_KEY environment variable not set."
    
        base = "https://financialmodelingprep.com/stable"
        endpoint_map = {
            "dcf": "discounted-cash-flow",
            "levered": "levered-discounted-cash-flow",
        }
        endpoint = endpoint_map.get(valuation_type.lower())
        if not endpoint:
            return "Error: invalid valuation type"
    
        url = f"{base}/{endpoint}"
        try:
            resp = requests.get(url, params={"symbol": symbol, "apikey": api_key}, timeout=10)
            resp.raise_for_status()
            data = resp.json()
        except Exception as e:
            return f"Error: getting {valuation_type} DCF for {symbol}: {e}"
        return json.dumps(data)
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. It states the tool retrieves data ('获取'), implying a read-only operation, but doesn't disclose behavioral traits like authentication needs, rate limits, data freshness, error conditions, or what the output contains. For a financial data tool with zero annotation coverage, this is a significant gap.

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

Conciseness4/5

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

The description is appropriately sized and front-loaded: the first sentence states the purpose, followed by parameter details. There's no wasted text, and the bilingual presentation (Chinese purpose, Chinese parameter labels with English hints) is efficient. However, the structure could be slightly improved by integrating the parameter explanations more seamlessly.

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 (financial valuation tool), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what the returned data includes (e.g., valuation metrics, assumptions), how to interpret results, or any limitations. For a tool with 2 parameters and significant domain specificity, more context is needed to be fully helpful.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds meaningful semantics beyond the input schema. The schema has 0% description coverage (titles only: 'Symbol' and 'Valuation Type'), while the description explains that 'valuation_type' can be 'dcf' or 'levered' and 'symbol' is a stock code. This compensates well for the low schema coverage, though it doesn't detail format constraints (e.g., symbol conventions).

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: '获取 DCF 或杠杆 DCF 估值数据' (Get DCF or levered DCF valuation data). It specifies the verb ('获取' - get) and resource ('估值数据' - valuation data), and distinguishes between DCF and levered DCF types. However, it doesn't explicitly differentiate from sibling tools like get_financial_statement or get_analyst_estimates, which might also provide valuation-related 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 any prerequisites, context for choosing between DCF and levered DCF, or how it differs from other financial data tools in the sibling list (e.g., get_analyst_estimates). Usage is implied by the parameter descriptions but not explicitly stated.

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

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/16Coffee/finance-mcp'

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