Skip to main content
Glama
Nayshins

Cryptocurrency Market Data MCP Server

by Nayshins

get-price

Fetch current cryptocurrency prices from major exchanges like Binance, Coinbase, and Kraken by specifying trading pairs such as BTC/USDT or ETH/USDT.

Instructions

Get current price of a cryptocurrency pair from a specific exchange

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

  • src/server.py:105-119 (registration)
    Registration of the 'get-price' tool in the handle_list_tools function, defining its name, description, and input schema.
    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"],
        },
    ),
  • The core handler logic for the 'get-price' tool within the handle_call_tool function. It retrieves the ticker data using ccxt and returns the current last price.
    if name == "get-price":
        symbol = arguments.get("symbol", "").upper()
        ticker = await exchange.fetch_ticker(symbol)
    
        return [
            types.TextContent(
                type="text",
                text=f"Current price of {symbol} on {exchange_id.upper()}: {ticker['last']} {symbol.split('/')[1]}"
            )
        ]
  • Input schema definition for the 'get-price' tool, specifying required 'symbol' parameter and optional '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 that generates the JSON schema for selecting supported exchanges, referenced in the 'get-price' tool's input schema.
    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 retrieve or initialize a CCXT exchange instance, used by the 'get-price' handler.
    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 'current price' and 'specific exchange' but fails to address critical aspects like rate limits, error handling, authentication needs, or response format. For a real-time data tool, this leaves significant behavioral gaps.

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 front-loads the core purpose without unnecessary elaboration. Every word contributes directly to understanding the tool's function, 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.

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 real-time data tool. It omits details on return values (e.g., price format, timestamp), error conditions, or performance considerations, which are essential for effective agent use in a financial context.

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 schema description coverage is 100%, with both parameters (symbol and exchange) fully documented in the schema. The description adds no additional semantic context beyond what the schema provides, such as examples of valid symbols beyond BTC/USDT or implications of exchange selection. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Get current price') and resource ('cryptocurrency pair from a specific exchange'), distinguishing it from siblings like get-historical-ohlcv (historical data) and get-market-summary (broader market info). It precisely defines the tool's scope without ambiguity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for real-time price queries but provides no explicit guidance on when to use this tool versus alternatives like get-price-change (for price changes) or get-historical-ohlcv (for historical data). It lacks context on prerequisites or exclusions, leaving usage decisions to inference.

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