get_crypto_quote_short
Retrieve a concise summary of cryptocurrency market data by specifying the symbol. Access real-time prices and essential details from Yahoo Finance for informed trading decisions.
Instructions
获取指定加密货币的简要行情。
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes |
Implementation Reference
- server.py:1146-1160 (handler)The handler function that implements the tool logic: fetches short crypto quote for a given symbol using the Financial Modeling Prep API, returns JSON string or error message.async def get_crypto_quote_short(symbol: str) -> 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/quote-short" 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 short crypto quote for {symbol}: {e}" return json.dumps(data)
- server.py:1142-1145 (registration)The @fmp_server.tool decorator that registers the get_crypto_quote_short tool with its name and description.@fmp_server.tool( name="get_crypto_quote_short", description="""获取指定加密货币的简要行情。""", )