Skip to main content
Glama
16Coffee

Yahoo Finance MCP Server

by 16Coffee

get_stock_grade_latest_news

Retrieve recent stock rating updates from Yahoo Finance MCP Server. Customize results by page and limit to stay informed on market evaluations and analyst insights.

Instructions

获取最新评级新闻。

参数说明: page: int 页码,默认 0 limit: int 每页数量,最大 1000,默认 10

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
pageNo

Implementation Reference

  • The handler function that implements the tool logic. It fetches the latest stock grade news from the Financial Modeling Prep API endpoint 'grades-latest-news' using the provided page and limit parameters, handles API key, makes HTTP request, and returns JSON data or error.
    async def get_stock_grade_latest_news(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/grades-latest-news"
        try:
            resp = requests.get(
                url,
                params={"page": page, "limit": limit, "apikey": api_key},
                timeout=10,
            )
            resp.raise_for_status()
            data = resp.json()
        except Exception as e:
            return f"Error: getting latest grade news: {e}"
        return json.dumps(data)
  • server.py:845-854 (registration)
    The registration of the tool using the @fmp_server.tool decorator, specifying the name and description including parameter details.
    @fmp_server.tool(
        name="get_stock_grade_latest_news",
        description="""获取最新评级新闻。
    
    参数说明:
        page: int
            页码,默认 0
        limit: int
            每页数量,最大 1000,默认 10""",
    )
  • The function signature providing input schema via type hints (page: int default 0, limit: int default 10) and output as str (JSON).
    async def get_stock_grade_latest_news(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. While it mentions pagination parameters, it doesn't describe important behavioral aspects like whether this is a read-only operation, what authentication might be required, rate limits, what format the news is returned in, or whether there are any side effects. For a news retrieval tool with zero annotation coverage, this leaves significant gaps in understanding how the tool behaves.

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 efficiently structured with a clear purpose statement followed by well-organized parameter documentation. Every sentence serves a purpose, and there's no wasted text. The parameter explanations are concise yet complete. The only minor improvement would be better separation between the purpose statement and parameter documentation.

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 tool's moderate complexity (2 parameters, no output schema, no annotations), the description provides adequate but incomplete coverage. It fully documents the parameters, which is good, but lacks important context about the tool's behavior, return format, and differentiation from similar tools. For a news retrieval tool, users need to know what kind of data to expect in return, which isn't addressed.

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

Parameters5/5

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

With 0% schema description coverage, the description fully compensates by providing complete parameter documentation in Chinese. It explains both parameters (page and limit), their data types, default values, and constraints (limit maximum of 1000). This adds substantial value beyond what the bare schema provides, making the parameter usage clear despite the schema's lack of descriptions.

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 as '获取最新评级新闻' (get latest rating news), which is a specific verb+resource combination. It distinguishes itself from siblings like 'get_ratings' or 'get_stock_grades' by focusing specifically on news about ratings. However, it doesn't explicitly differentiate from 'get_stock_grade_news' which appears to be a very similar sibling tool.

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. With siblings like 'get_ratings', 'get_stock_grades', and the very similar 'get_stock_grade_news', there's no indication of what makes this tool distinct or when it should be preferred over other rating-related tools. The description only explains what the tool does, not when to use it.

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