Skip to main content
Glama
Nayshins

Cryptocurrency Market Data MCP Server

by Nayshins

get-price-change

Analyze cryptocurrency price fluctuations by fetching price change statistics over specific time periods. Input a trading pair symbol and select an exchange to retrieve data for market analysis and trend tracking.

Instructions

Get price change statistics over different time periods

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

  • Executes the get-price-change tool: fetches current price using fetch_ticker, then computes percentage price changes over 1h, 24h, 7d, and 30d periods using historical OHLCV data from ccxt exchange.
    elif name == "get-price-change": symbol = arguments.get("symbol", "").upper() # Get current price ticker = await exchange.fetch_ticker(symbol) current_price = ticker['last'] # Get historical prices timeframes = { "1h": (1, "1h"), "24h": (1, "1d"), "7d": (7, "1d"), "30d": (30, "1d") } changes = [] for label, (days, timeframe) in timeframes.items(): since = int((datetime.now() - timedelta(days=days)).timestamp() * 1000) ohlcv = await exchange.fetch_ohlcv(symbol, timeframe, since=since, limit=1) if ohlcv: start_price = ohlcv[0][1] # Open price change_pct = ((current_price - start_price) / start_price) * 100 changes.append(f"{label} change: {change_pct:+.2f}%") return [ types.TextContent( type="text", text=f"Price changes for {symbol} on {exchange_id.upper()}:\n\n" + "\n".join(changes) ) ]
  • src/server.py:185-199 (registration)
    Registers the get-price-change tool in the MCP server with its input schema, including symbol (required) and optional exchange.
    types.Tool( name="get-price-change", description="Get price change statistics over different time periods", inputSchema={ "type": "object", "properties": { "symbol": { "type": "string", "description": "Trading pair symbol (e.g., BTC/USDT, ETH/USDT)", }, "exchange": get_exchange_schema() }, "required": ["symbol"], }, ),

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