Skip to main content
Glama
16Coffee

Yahoo Finance MCP Server

by 16Coffee

get_crypto_intraday

Fetch intraday cryptocurrency prices at customizable intervals (1min, 5min, 1hour) using Yahoo Finance data to monitor real-time market movements and trends.

Instructions

按时间间隔获取加密货币的分时价格,支持 1min、5min 和 1hour。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
intervalNo1min
symbolYes

Implementation Reference

  • The handler function that implements the get_crypto_intraday tool by fetching intraday crypto price data from the Financial Modeling Prep API, validating the interval, and returning JSON data.
    async def get_crypto_intraday(symbol: str, interval: str = "1min") -> str:
        """获取加密货币的分时价格"""
    
        api_key = os.environ.get("FMP_API_KEY")
        if not api_key:
            return "Error: FMP_API_KEY environment variable not set."
    
        allowed = {"1min", "5min", "1hour"}
        if interval not in allowed:
            return "Error: invalid interval"
    
        url = f"https://financialmodelingprep.com/stable/historical-chart/{interval}"
        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 {interval} crypto data for {symbol}: {e}"
        return json.dumps(data)
  • server.py:1211-1214 (registration)
    The decorator that registers the get_crypto_intraday tool with the MCP server, including its name and description.
    @fmp_server.tool(
        name="get_crypto_intraday",
        description="""按时间间隔获取加密货币的分时价格,支持 1min、5min 和 1hour。""",
    )
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool fetches intraday prices and supports specific intervals, but doesn't mention critical behaviors like whether this is a read-only operation, rate limits, authentication requirements, data freshness, error handling, or response format. For a data-fetching 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.

Conciseness5/5

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

The description is extremely concise - a single sentence in Chinese that directly states the tool's function and parameter constraints. It's front-loaded with the core purpose and wastes no words. Every part of the sentence earns its place by providing essential information.

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's complexity (data fetching with time intervals), no annotations, no output schema, and incomplete parameter documentation, the description is insufficient. It doesn't explain what the tool returns (price data structure, timestamps, fields), error conditions, or behavioral constraints. For a financial data tool, users need to understand the output format and limitations.

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 adds some semantic context: it explains that 'interval' accepts '1min, 5min and 1hour' values, which the schema doesn't specify (0% coverage). However, it doesn't clarify the 'symbol' parameter format (e.g., ticker conventions like BTC/USD). With 2 parameters and 0% schema description coverage, the description partially compensates but doesn't fully document both parameters.

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: '获取加密货币的分时价格' (get intraday cryptocurrency prices) with specific time intervals. It uses a specific verb ('获取' - get) and resource ('加密货币的分时价格' - cryptocurrency intraday prices). However, it doesn't explicitly distinguish this from sibling tools like 'get_crypto_price_eod' (end-of-day prices) or 'get_crypto_quote' (current quotes), which would require a 5.

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_crypto_price_eod' for end-of-day prices or 'get_crypto_quote' for current quotes, nor does it specify use cases or exclusions. The only implied context is needing intraday data, but this is minimal guidance.

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