Skip to main content
Glama
Nayshins

Cryptocurrency Market Data MCP Server

by Nayshins

get-market-summary

Retrieve a detailed market summary for any cryptocurrency pair from supported exchanges like Binance, Coinbase, and Kraken, providing key trading insights.

Instructions

Get detailed market summary for a cryptocurrency pair from a specific exchange

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
exchangeNoExchange to use (supported: binance, coinbase, kraken, kucoin, hyperliquid, huobi, bitfinex, bybit, okx, mexc)binance
symbolYesTrading pair symbol (e.g., BTC/USDT, ETH/USDT)

Implementation Reference

  • Handler implementation for the 'get-market-summary' tool. Fetches the ticker data for the given symbol using the exchange's fetch_ticker method, formats it using format_ticker helper, and returns a formatted text content response.
    elif name == "get-market-summary": symbol = arguments.get("symbol", "").upper() ticker = await exchange.fetch_ticker(symbol) formatted_data = await format_ticker(ticker, exchange_id) return [ types.TextContent( type="text", text=f"Market summary for {symbol}:\n\n{formatted_data}" ) ]
  • src/server.py:120-134 (registration)
    Registration of the 'get-market-summary' tool in the list_tools handler, including its name, description, and input schema.
    types.Tool( name="get-market-summary", description="Get detailed market summary for a cryptocurrency pair from a specific exchange", inputSchema={ "type": "object", "properties": { "symbol": { "type": "string", "description": "Trading pair symbol (e.g., BTC/USDT, ETH/USDT)", }, "exchange": get_exchange_schema() }, "required": ["symbol"], }, ),
  • Helper function providing the JSON schema for the 'exchange' parameter, used in the inputSchema of get-market-summary.
    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 human-readable string, used by the get-market-summary handler.
    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 function to retrieve or initialize a ccxt exchange instance, used by all tools including get-market-summary.
    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]

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