Skip to main content
Glama
16Coffee

Yahoo Finance MCP Server

by 16Coffee

get_stock_grades_summary

Retrieve summarized analyst ratings for stocks to assess investment potential. Input a stock ticker to access actionable insights from financial experts.

Instructions

获取分析师评级汇总。

参数说明: ticker: str 股票代码,例如 "AAPL

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tickerYes

Implementation Reference

  • The handler function that implements the get_stock_grades_summary tool. It retrieves the analyst grades consensus summary for a given stock ticker from the Financial Modeling Prep API and returns the data as JSON.
    async def get_stock_grades_summary(ticker: str) -> 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/grades-consensus"
        try:
            resp = requests.get(url, params={"symbol": ticker, "apikey": api_key}, timeout=10)
            resp.raise_for_status()
            data = resp.json()
        except Exception as e:
            return f"Error: getting grades summary for {ticker}: {e}"
        return json.dumps(data)
  • server.py:782-789 (registration)
    The @fmp_server.tool decorator that registers the get_stock_grades_summary tool with the MCP server, including its name and description defining the input parameter (ticker: str).
    @fmp_server.tool(
        name="get_stock_grades_summary",
        description="""获取分析师评级汇总。
    
    参数说明:
        ticker: str
            股票代码,例如 "AAPL""",
    )
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 only states the purpose without adding any behavioral traits such as whether it's read-only, requires authentication, has rate limits, or describes the return format. For a tool with zero annotation coverage, this is a significant gap in transparency.

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 with the purpose in the first sentence, followed by a parameter explanation. It avoids unnecessary verbosity, but the structure could be slightly improved by integrating the parameter details more seamlessly rather than as a separate section.

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 tool has no annotations, no output schema, and low schema description coverage (0%), the description is incomplete. It lacks information on behavioral traits, return values, and usage context. For a tool with these gaps, the description should provide more comprehensive guidance to be adequately complete.

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 description includes a parameter section that explains 'ticker' as a stock code with an example 'AAPL', adding meaning beyond the input schema which has 0% description coverage. However, it only covers the single parameter without detailing format constraints or other nuances, so it partially compensates but doesn't fully address the schema gap.

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 states a clear purpose: '获取分析师评级汇总' (Get analyst rating summary). It specifies the verb '获取' (get) and resource '分析师评级汇总' (analyst rating summary), making it understandable. However, it doesn't explicitly distinguish this tool from sibling tools like 'get_ratings' or 'get_stock_grades', which appear related, so it misses full sibling differentiation.

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_stock_grades', nor does it specify any context, prerequisites, or exclusions for usage. This leaves the agent without clear direction on tool selection.

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