Skip to main content
Glama
Nayshins

Cryptocurrency Market Data MCP Server

by Nayshins

get-top-volumes

Retrieve top cryptocurrencies by trading volume from major exchanges to analyze market activity and identify high-volume trading pairs.

Instructions

Get top cryptocurrencies by trading volume from a specific exchange

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of pairs to return (default: 5)
exchangeNoExchange to use (supported: binance, coinbase, kraken, kucoin, hyperliquid, huobi, bitfinex, bybit, okx, mexc)binance

Implementation Reference

  • Handler implementation for the 'get-top-volumes' tool. Fetches all tickers from the specified exchange using CCXT, sorts them by 24h base volume (descending), selects the top N (default 5), formats each using format_ticker helper, and returns a formatted text response listing the top pairs.
    elif name == "get-top-volumes":
        limit = int(arguments.get("limit", 5))
        tickers = await exchange.fetch_tickers()
    
        # Sort by volume and get top N
        sorted_tickers = sorted(
            tickers.values(),
            key=lambda x: float(x.get('baseVolume', 0) or 0),
            reverse=True
        )[:limit]
    
        formatted_results = []
        for ticker in sorted_tickers:
            formatted_data = await format_ticker(ticker, exchange_id)
            formatted_results.append(formatted_data)
    
        return [
            types.TextContent(
                type="text",
                text=f"Top {limit} pairs by volume on {exchange_id.upper()}:\n\n" + "\n".join(formatted_results)
            )
        ]
  • src/server.py:135-148 (registration)
    Tool registration in the @server.list_tools() handler, defining the tool name, description, and input schema (optional 'limit' number and 'exchange' string from supported exchanges).
    types.Tool(
        name="get-top-volumes",
        description="Get top cryptocurrencies by trading volume from a specific exchange",
        inputSchema={
            "type": "object",
            "properties": {
                "limit": {
                    "type": "number",
                    "description": "Number of pairs to return (default: 5)",
                },
                "exchange": get_exchange_schema()
            }
        },
    ),
  • Shared schema function providing JSON schema for the 'exchange' input parameter used across tools, including get-top-volumes (defines type string, enum of supported exchanges, default 'binance').
    def get_exchange_schema() -> Dict[str, Any]:
        """Get the JSON schema for exchange selection."""
        return {
            "type": "string",
            "description": f"Exchange to use (supported: {', '.join(SUPPORTED_EXCHANGES.keys())})",
            "enum": list(SUPPORTED_EXCHANGES.keys()),
            "default": "binance"
        }
  • Helper function to format individual ticker data (symbol, prices, volume, bid/ask) into a multi-line string, used by the get-top-volumes handler to display each top volume pair.
    async def format_ticker(ticker: Dict[str, Any], exchange_id: str) -> str:
        """Format ticker data into a readable string."""
        return (
            f"Exchange: {exchange_id.upper()}\n"
            f"Symbol: {ticker.get('symbol')}\n"
            f"Last Price: {ticker.get('last', 'N/A')}\n"
            f"24h High: {ticker.get('high', 'N/A')}\n"
            f"24h Low: {ticker.get('low', 'N/A')}\n"
            f"24h Volume: {ticker.get('baseVolume', 'N/A')}\n"
            f"Bid: {ticker.get('bid', 'N/A')}\n"
            f"Ask: {ticker.get('ask', 'N/A')}\n"
            "---"
        )
  • Helper to lazily initialize and cache CCXT exchange instances for supported exchanges, used indirectly by get-top-volumes via the common flow.
    async def get_exchange(exchange_id: str) -> ccxt.Exchange:
        """Get or create an exchange instance."""
        exchange_id = exchange_id.lower()
        if exchange_id not in SUPPORTED_EXCHANGES:
            raise ValueError(f"Unsupported exchange: {exchange_id}")
    
        if exchange_id not in exchange_instances:
            exchange_class = SUPPORTED_EXCHANGES[exchange_id]
            exchange_instances[exchange_id] = exchange_class()
    
        return exchange_instances[exchange_id]
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 mentions the tool retrieves data ('Get top cryptocurrencies'), implying a read-only operation, but doesn't specify whether it's real-time or cached, rate limits, authentication needs, or what happens if the exchange is unavailable. This leaves significant gaps for a data-fetching tool.

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 a single, efficient sentence that directly states the tool's purpose without any unnecessary words. It's front-loaded and wastes no space, making it highly concise and well-structured.

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's moderate complexity (fetching ranked data from exchanges), no annotations, and no output schema, the description is minimally adequate. It specifies the resource and scope but lacks details on behavior, output format, or error handling, leaving room for improvement in completeness.

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 input schema has 100% description coverage, with clear documentation for both parameters (limit and exchange), including defaults and enum values. The description adds no additional parameter semantics beyond what the schema provides, so it meets the baseline score of 3.

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 action ('Get top cryptocurrencies by trading volume') and resource ('from a specific exchange'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'get-volume-history' or 'get-market-summary', which might also involve volume data, so it doesn't reach the highest 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 like 'get-volume-history' or 'get-market-summary', nor does it mention prerequisites or exclusions. It only states what the tool does without contextual usage information.

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/Nayshins/mcp-server-ccxt'

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