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 like Binance, Coinbase, and Kraken. Specify the exchange and limit to fetch the most actively traded pairs for market analysis.

Instructions

Get top cryptocurrencies by trading volume from a specific exchange

Input Schema

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

Implementation Reference

  • Executes the get-top-volumes tool: fetches all tickers from the exchange, sorts by baseVolume descending, takes top 'limit' pairs, formats each ticker info using format_ticker helper, and returns formatted text content.
    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)
    Registers the get-top-volumes tool in the list_tools handler, including its description and input schema (limit optional number, exchange from supported list).
    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() } }, ),
  • Defines the JSON schema for the 'exchange' parameter used in get-top-volumes inputSchema and other tools.
    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 ticker data into a multi-line string, used in get-top-volumes 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" "---" )

Other Tools

Related 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