Skip to main content
Glama
16Coffee

Yahoo Finance MCP Server

by 16Coffee

get_top_gainers

Retrieve a list of today's top-performing stocks from Yahoo Finance to identify significant market trends and opportunities.

Instructions

获取今日涨幅最大的股票列表。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function that fetches the list of top gaining stocks from the Financial Modeling Prep API endpoint '/stock_market/gainers' and returns the data as a JSON string.
    async def get_top_gainers() -> 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/api/v3/stock_market/gainers"
        try:
            resp = requests.get(url, params={"apikey": api_key}, timeout=10)
            resp.raise_for_status()
            data = resp.json()
        except Exception as e:
            return f"Error: getting top gainers: {e}"
        return json.dumps(data)
  • server.py:684-687 (registration)
    Registers the 'get_top_gainers' tool with the FastMCP server instance 'fmp_server' using the @tool decorator, providing the tool name and Chinese description.
    @fmp_server.tool(
        name="get_top_gainers",
        description="""获取今日涨幅最大的股票列表。""",
    )
Behavior2/5

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

With no annotations provided, the description carries full burden but only states what the tool does without behavioral details. It doesn't disclose whether this is a read-only operation, how data is sourced (e.g., real-time vs. delayed), rate limits, or output format, which are critical for a financial data tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence in Chinese that directly states the tool's function without any fluff. It's front-loaded and every word contributes to understanding the purpose, making it highly concise and well-structured.

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 complexity of financial data tools and lack of annotations or output schema, the description is incomplete. It doesn't explain what 'top gainers' means (e.g., by percentage or absolute value), how many stocks are returned, data freshness, or error handling, leaving significant gaps for agent usage.

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 tool has 0 parameters with 100% schema description coverage, so no parameter documentation is needed. The description appropriately doesn't discuss parameters, maintaining focus on the tool's purpose, which aligns with the baseline for zero-parameter tools.

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 action ('获取' meaning 'get') and resource ('今日涨幅最大的股票列表' meaning 'today's top gaining stock list'), providing a specific purpose. However, it doesn't explicitly differentiate from sibling tools like 'get_top_losers' beyond the obvious opposite direction, which prevents a perfect score.

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 prerequisites, frequency limits, or compare it to similar tools like 'get_stock_grades' or 'get_historical_stock_prices' for performance analysis, leaving usage context unclear.

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