Skip to main content
Glama
16Coffee

Yahoo Finance MCP Server

by 16Coffee

get_analyst_estimates

Retrieve analyst financial estimates for stocks by providing the symbol, period, page, and limit parameters. Access detailed forecasts for informed investment decisions.

Instructions

获取分析师的财务预估数据。

参数说明: symbol: str 股票代码,例如 "AAPL" period: str annual 或 quarter,默认 annual page: int 页码,默认 0 limit: int 返回数量,默认 10

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
pageNo
periodNoannual
symbolYes

Implementation Reference

  • The main handler function that implements the get_analyst_estimates tool. It fetches analyst estimates data from the Financial Modeling Prep API using requests, handles errors, and returns JSON string.
    async def get_analyst_estimates(
        symbol: str, period: str = "annual", page: int = 0, limit: int = 10
    ) -> str:
        """获取分析师预估指标"""
    
        api_key = os.environ.get("FMP_API_KEY")
        if not api_key:
            return "Error: FMP_API_KEY environment variable not set."
    
        url = "https://financialmodelingprep.com/stable/analyst-estimates"
        try:
            resp = requests.get(
                url,
                params={
                    "symbol": symbol,
                    "period": period,
                    "page": page,
                    "limit": limit,
                    "apikey": api_key,
                },
                timeout=10,
            )
            resp.raise_for_status()
            data = resp.json()
        except Exception as e:
            return f"Error: getting analyst estimates for {symbol}: {e}"
        return json.dumps(data)
  • server.py:961-974 (registration)
    The @fmp_server.tool decorator that registers the get_analyst_estimates tool, specifying its name and description with parameter details serving as schema information.
    @fmp_server.tool(
        name="get_analyst_estimates",
        description="""获取分析师的财务预估数据。
    
    参数说明:
        symbol: str
            股票代码,例如 "AAPL"
        period: str
            annual 或 quarter,默认 annual
        page: int
            页码,默认 0
        limit: int
            返回数量,默认 10""",
    )
  • The function signature with type annotations defining the input schema (parameters) and output type.
    async def get_analyst_estimates(
        symbol: str, period: str = "annual", page: int = 0, limit: int = 10
    ) -> str:
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 data ('获取'), implying a read-only operation, but doesn't clarify permissions, rate limits, data freshness, or potential side effects. For a data retrieval tool with zero annotation coverage, this leaves significant gaps in understanding how it behaves beyond basic functionality.

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 clearly, followed by a structured parameter list. Each sentence earns its place by providing essential information without redundancy. It could be slightly more concise by integrating defaults into the parameter explanations more smoothly, but overall it's efficient.

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

Completeness3/5

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

Given the complexity (4 parameters, no annotations, no output schema), the description is moderately complete. It covers the purpose and parameters well, but lacks behavioral context (e.g., pagination details, error handling, data format) and doesn't explain return values. For a data retrieval tool, this is adequate but leaves room for improvement in operational transparency.

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 substantial meaning beyond the input schema, which has 0% description coverage. It explains all four parameters: 'symbol' as stock code (e.g., 'AAPL'), 'period' as annual or quarter with default 'annual', 'page' as page number with default 0, and 'limit' as return count with default 10. This compensates well for the schema's lack of descriptions, though it doesn't detail constraints like valid symbol formats or period enum values.

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 analyst financial estimate data). It specifies the verb '获取' (get) and the resource '分析师的财务预估数据' (analyst financial estimate data), which is specific enough to understand what it does. However, it doesn't explicitly differentiate from sibling tools like 'get_ratings' or 'get_price_target_info', which might also relate to analyst 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 sibling tools like 'get_ratings' or 'get_price_target_info', nor does it specify any prerequisites, contexts, or exclusions for usage. The only implied usage is for retrieving analyst estimates, but without comparative context.

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