Skip to main content
Glama
16Coffee

Yahoo Finance MCP Server

by 16Coffee

get_crypto_price_eod

Retrieve historical end-of-day cryptocurrency prices via Yahoo Finance MCP Server, supporting both light and full data modes for analysis and insights.

Instructions

获取加密货币的历史收盘价,可选简略或完整模式。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNolight
symbolYes

Implementation Reference

  • Handler function implementing the get_crypto_price_eod tool logic, fetching historical EOD crypto prices from Financial Modeling Prep API in light or full mode.
    async def get_crypto_price_eod(symbol: str, mode: str = "light") -> str:
        """获取加密货币 EOD 数据"""
    
        api_key = os.environ.get("FMP_API_KEY")
        if not api_key:
            return "Error: FMP_API_KEY environment variable not set."
    
        base = "https://financialmodelingprep.com/stable/historical-price-eod"
        endpoint_map = {"light": "light", "full": "full"}
        endpoint = endpoint_map.get(mode.lower())
        if not endpoint:
            return "Error: invalid mode"
    
        url = f"{base}/{endpoint}"
        try:
            resp = requests.get(url, params={"symbol": symbol, "apikey": api_key}, timeout=10)
            resp.raise_for_status()
            data = resp.json()
        except Exception as e:
            return f"Error: getting {mode} crypto prices for {symbol}: {e}"
        return json.dumps(data)
  • server.py:1184-1187 (registration)
    Registers the get_crypto_price_eod tool with the MCP server using the @tool decorator, including name and description.
    @fmp_server.tool(
        name="get_crypto_price_eod",
        description="""获取加密货币的历史收盘价,可选简略或完整模式。""",
    )
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. It mentions '可选简略或完整模式' (optional light or full mode), which hints at behavioral differences in output format, but doesn't disclose what these modes entail, rate limits, authentication needs, error conditions, or data freshness. For a tool with no 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 a single, efficient sentence in Chinese that front-loads the core purpose. There's no wasted text, and it directly addresses the tool's function. However, it could be slightly more structured by separating purpose from parameter guidance.

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 no annotations, no output schema, and low schema coverage, the description is incomplete. It doesn't explain return values (e.g., price data format), error handling, or historical scope (e.g., date range defaults). For a tool fetching financial data, this lacks critical context needed for reliable agent use.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate. It mentions 'mode' parameter with light/full options, adding some semantics beyond the schema's basic type info. However, it doesn't explain the 'symbol' parameter (e.g., format like BTC/USD), nor does it cover any date-related parameters implied by '历史' (historical). With 2 parameters and low coverage, this is insufficient.

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 verb '获取' (get/retrieve) and resource '加密货币的历史收盘价' (historical closing prices of cryptocurrencies), which is specific. It distinguishes from siblings like get_crypto_intraday (intraday prices) and get_crypto_quote (current quotes) by focusing on historical end-of-day data. However, it doesn't explicitly mention the time range or date parameters, which would make it fully distinct.

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 siblings like get_crypto_intraday for intraday data or get_crypto_quote for current prices, nor does it specify prerequisites such as required symbols or date ranges. The optional mode parameter is mentioned but without context on when to choose light vs. full mode.

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