Skip to main content
Glama
Nayshins

Cryptocurrency Market Data MCP Server

by Nayshins

get-price-change

Retrieve cryptocurrency price change statistics over various time periods from major exchanges to analyze market trends and performance.

Instructions

Get price change statistics over different time periods

Input Schema

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

Implementation Reference

  • Handler function implementing the logic for the 'get-price-change' tool. Fetches current price and compares it against historical open prices from 1h, 24h, 7d, and 30d periods to calculate percentage changes.
    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)
            )
        ]
  • Input schema definition for the 'get-price-change' tool, specifying required 'symbol' and optional 'exchange' parameters.
    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"],
        },
    ),
  • src/server.py:103-221 (registration)
    The tool is registered within the @server.list_tools() handler by including it in the returned list of available tools.
    return [
        # Market Data Tools
        types.Tool(
            name="get-price",
            description="Get current price of 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"],
            },
        ),
        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"],
            },
        ),
        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()
                }
            },
        ),
        types.Tool(
            name="list-exchanges",
            description="List all supported cryptocurrency exchanges",
            inputSchema={
                "type": "object",
                "properties": {}
            },
        ),
        # Historical Data Tools
        types.Tool(
            name="get-historical-ohlcv",
            description="Get historical OHLCV (candlestick) data for a trading pair",
            inputSchema={
                "type": "object",
                "properties": {
                    "symbol": {
                        "type": "string",
                        "description": "Trading pair symbol (e.g., BTC/USDT, ETH/USDT)",
                    },
                    "timeframe": {
                        "type": "string",
                        "description": "Timeframe for candlesticks (e.g., 1m, 5m, 15m, 1h, 4h, 1d)",
                        "enum": ["1m", "5m", "15m", "1h", "4h", "1d"],
                        "default": "1h"
                    },
                    "days_back": {
                        "type": "number",
                        "description": "Number of days of historical data to fetch (default: 7, max: 30)",
                        "default": 7,
                        "maximum": 30
                    },
                    "exchange": get_exchange_schema()
                },
                "required": ["symbol"],
            },
        ),
        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"],
            },
        ),
        types.Tool(
            name="get-volume-history",
            description="Get trading volume history over time",
            inputSchema={
                "type": "object",
                "properties": {
                    "symbol": {
                        "type": "string",
                        "description": "Trading pair symbol (e.g., BTC/USDT, ETH/USDT)",
                    },
                    "days": {
                        "type": "number",
                        "description": "Number of days of volume history (default: 7, max: 30)",
                        "default": 7,
                        "maximum": 30
                    },
                    "exchange": get_exchange_schema()
                },
                "required": ["symbol"],
            },
        ),
    ]
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 'price change statistics' but doesn't specify what statistics are included (e.g., percentage change, absolute values), time periods available, or any limitations like rate limits or data freshness. This leaves significant gaps in understanding the tool's behavior beyond basic functionality.

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 unnecessary words. It's front-loaded with the core action and resource, making it easy to parse quickly, and every part of the sentence contributes to understanding the tool's function.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete for a tool that likely returns complex statistical data. It doesn't explain what 'price change statistics' entail, the available time periods, or the format of the response, leaving the agent with insufficient context to use the tool effectively without trial and error.

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, including an enum for 'exchange' and a default value. The description adds no additional parameter semantics beyond what the schema provides, such as explaining how 'symbol' interacts with 'exchange' or detailing time period options. This meets the baseline for high schema coverage.

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 as 'Get price change statistics over different time periods,' which specifies the action (get) and resource (price change statistics) with a time dimension. However, it doesn't explicitly distinguish this from sibling tools like 'get-price' or 'get-historical-ohlcv,' which might provide overlapping or related data, leaving some ambiguity about its unique role.

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. It doesn't mention sibling tools like 'get-price' or 'get-historical-ohlcv,' nor does it specify scenarios or exclusions for its use, leaving the agent to infer usage from context alone.

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