get_crypto_list
Retrieve a comprehensive list of cryptocurrencies currently listed on exchanges using Yahoo Finance MCP Server for accurate, real-time market data.
Instructions
获取交易所上市的加密货币列表。
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- server.py:1104-1118 (handler)The main handler function that implements the get_crypto_list tool by fetching the cryptocurrency list from the Financial Modeling Prep API and returning it as a JSON string.async def get_crypto_list() -> 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/cryptocurrency-list" 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 cryptocurrency list: {e}" return json.dumps(data)
- server.py:1100-1103 (registration)The decorator that registers the get_crypto_list tool with the MCP server, specifying its name and description.@fmp_server.tool( name="get_crypto_list", description="""获取交易所上市的加密货币列表。""", )