Skip to main content
Glama

search_crypto

Search for cryptocurrencies by name or symbol to identify and retrieve market data for trading and portfolio management.

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
NameRequiredDescriptionDefault
queryYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for the 'search_crypto' tool. It uses the CoinGecko API to search for cryptocurrencies matching the input query and returns a formatted string with the top 10 results including name, symbol, ID, and market cap rank.
    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 'search_crypto' as an MCP tool in the server.py file, along with other cryptocurrency tools, using the register_tools helper function.
    register_tools(
        [get_crypto_price, get_crypto_market_data, get_trending_crypto, search_crypto],
        "Cryptocurrency"
    )
  • server.py:21-21 (registration)
    Import statement for the search_crypto function in server.py, necessary for its registration.
    from tools.crypto_data import get_crypto_price, get_crypto_market_data, get_trending_crypto, search_crypto
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 states the tool searches and returns a formatted string, but lacks details on behavioral traits like rate limits, authentication needs, error handling, or whether it's a read-only operation. This is a significant gap for a tool with no annotation coverage.

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 appropriately sized and front-loaded, with the core purpose stated first. The Args and Returns sections are structured clearly. However, the 'Returns' section is somewhat vague ('Formatted string with search results'), and the overall text could be slightly more efficient, but it avoids unnecessary fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has an output schema (which should cover return values), the description doesn't need to explain returns in detail. However, with no annotations and only one parameter, it provides basic purpose and parameter info but lacks usage guidelines and behavioral context, making it minimally adequate but incomplete for effective agent use.

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 meaning beyond the input schema, which has 0% description coverage. It explains that 'query' is a 'Search term (e.g., 'bitcoin', 'BTC', 'ethereum')', providing examples and clarifying its purpose. However, it doesn't detail constraints like length, case-sensitivity, or special characters, leaving room for improvement.

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: 'Searches for cryptocurrencies by name or symbol.' It specifies the verb ('searches') and resource ('cryptocurrencies'), and the scope ('by name or symbol') is helpful. However, it doesn't explicitly differentiate from sibling tools like 'get_crypto_market_data' or 'get_trending_crypto', which might offer overlapping functionality, preventing a perfect score.

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. For example, it doesn't compare to 'get_trending_crypto' for trending searches or 'get_crypto_market_data' for broader data. There's no mention of prerequisites, exclusions, or specific contexts, leaving usage ambiguous.

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

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/N-lia/MonteWalk'

If you have feedback or need assistance with the MCP directory API, please join our Discord server