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:

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