search_crypto
Find cryptocurrency information by name or symbol using the MonteWalk MCP server's search tool for market data and analysis.
Instructions
Searches for cryptocurrencies by name or symbol.
Args:
query: Search term (e.g., 'bitcoin', 'BTC', 'ethereum')
Returns:
Formatted string with search results
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes |
Implementation Reference
- tools/crypto_data.py:122-151 (handler)The core handler function for the 'search_crypto' tool. It uses the CoinGecko API to search for cryptocurrencies matching the query, limits to top 10 results, and formats a string output with coin names, symbols, IDs, and market cap ranks.def search_crypto(query: str) -> str: """ Searches for cryptocurrencies by name or symbol. Args: query: Search term (e.g., 'bitcoin', 'BTC', 'ethereum') Returns: Formatted string with search results """ try: data = cg.search(query=query) coins = data.get('coins', []) if not coins: return f"No results found for '{query}'" summary = [f"=== SEARCH RESULTS FOR '{query}' ===\n"] for coin in coins[:10]: summary.append( f"• {coin.get('name')} ({coin.get('symbol', 'N/A').upper()})" f" - ID: {coin.get('id')} - Rank #{coin.get('market_cap_rank', 'N/A')}" ) summary.append("\nUse the 'id' with get_crypto_market_data() for detailed info") return "\n".join(summary) except Exception as e: logger.error(f"CoinGecko search error: {e}") return f"Error searching for '{query}': {str(e)}"
- server.py:415-418 (registration)Registers the search_crypto function (imported from tools.crypto_data) as an MCP tool in the 'Cryptocurrency' category using the register_tools helper.register_tools( [get_crypto_price, get_crypto_market_data, get_trending_crypto, search_crypto], "Cryptocurrency" )
- server.py:21-21 (registration)Import statement that brings the search_crypto handler into the server module for registration.from tools.crypto_data import get_crypto_price, get_crypto_market_data, get_trending_crypto, search_crypto