Skip to main content
Glama
16Coffee

Yahoo Finance MCP Server

by 16Coffee

get_stock_grade_news

Retrieve stock rating news for a specific ticker using customizable pagination. Access detailed financial insights directly from Yahoo Finance. Ideal for tracking market analyst updates efficiently.

Instructions

获取指定股票的评级新闻。

参数说明: ticker: str 股票代码,例如 "AAPL" page: int 页码,默认 0 limit: int 每页数量,最大 100,默认 1

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
pageNo
tickerYes

Implementation Reference

  • The main handler function that executes the tool logic: fetches analyst grade news for a given stock ticker from the FMP API endpoint /stable/grades-news, handles API key, pagination, and returns JSON data.
    async def get_stock_grade_news(ticker: str, page: int = 0, limit: int = 1) -> 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-news"
        try:
            resp = requests.get(
                url,
                params={
                    "symbol": ticker,
                    "page": page,
                    "limit": limit,
                    "apikey": api_key,
                },
                timeout=10,
            )
            resp.raise_for_status()
            data = resp.json()
        except Exception as e:
            return f"Error: getting grade news for {ticker}: {e}"
        return json.dumps(data)
  • server.py:807-818 (registration)
    Tool registration using the FastMCP decorator, specifying the tool name and description with input parameters (serving as schema).
    @fmp_server.tool(
        name="get_stock_grade_news",
        description="""获取指定股票的评级新闻。
    
    参数说明:
        ticker: str
            股票代码,例如 "AAPL"
        page: int
            页码,默认 0
        limit: int
            每页数量,最大 100,默认 1""",
    )
  • Description string defining the input schema: ticker (str), page (int, default 0), limit (int, default 1).
        description="""获取指定股票的评级新闻。
    
    参数说明:
        ticker: str
            股票代码,例如 "AAPL"
        page: int
            页码,默认 0
        limit: int
            每页数量,最大 100,默认 1""",
    )
  • Tool mentioned in the server instructions list.
    - get_stock_grade_news:获取指定股票的评级新闻。
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions pagination behavior (page/limit parameters with defaults) which is useful, but doesn't describe what 'rating news' entails, whether it's real-time or historical, what format the news items come in, or any rate limits/authentication requirements. For a tool with zero annotation coverage, this leaves significant behavioral gaps.

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 well-structured. The purpose statement is front-loaded, followed by organized parameter explanations. Every sentence earns its place by providing essential information. It could be slightly more concise by integrating the parameter explanations more seamlessly, 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 tool's moderate complexity (3 parameters, no output schema, no annotations), the description is adequate but has clear gaps. It covers parameters well but doesn't explain what 'rating news' means, what the return format looks like, or how this differs from similar tools. For a tool with no output schema and no annotations, more context about the return value would be 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 provides excellent parameter semantics despite 0% schema description coverage. It explains all 3 parameters with clear examples and constraints: ticker as stock code with 'AAPL' example, page as page number with default 0, and limit as items per page with max 100 and default 1. This fully compensates for 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 rating news for specified stock), which is a specific verb+resource combination. It distinguishes from siblings like get_stock_grades (which likely provides ratings data rather than news) and get_stock_grade_latest_news (which might provide only latest rather than paginated results). However, it doesn't explicitly differentiate from all similar siblings in the list.

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 when this tool is appropriate versus get_ratings, get_stock_grades, get_stock_grade_latest_news, or other news-related tools. There are no explicit when/when-not instructions or named alternatives provided.

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