Skip to main content
Glama
desk3
by desk3

get_token_price

Retrieve real-time cryptocurrency token prices by specifying trading pair symbols like BTCUSDT or ETHUSDT to monitor market values.

Instructions

Get real-time token price info, supports symbol parameter

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolNoTrading pair symbol in format like BTCUSDT, ETHUSDT, etc. Leave empty to get all symbols

Implementation Reference

  • The core handler function implementing the get_token_price tool logic, fetching real-time token prices from the Desk3 API endpoint.
    async def get_token_price(symbol: str | None = None) -> dict[str, Any]:
        """
        Get real-time token price information.
        :param symbol: Trading pair, comma separated for multiple, return all if not provided
        :return: Token price information
        """
        url = 'https://mcp.desk3.io/v1/market/price'
        params = {}
        if symbol:
            params['symbol'] = symbol
        try:
            return request_api('get', url, params=params)
        except Exception as e:
            raise RuntimeError(f"Failed to fetch token price data: {e}")
  • JSON Schema defining the input parameters for the 'get_token_price' tool, with optional 'symbol' string parameter.
    inputSchema={
        "type": "object",
        "properties": {
            "symbol": {
                "type": "string",
                "description": "Trading pair symbol in format like BTCUSDT, ETHUSDT, etc. Leave empty to get all symbols",
                "examples": ["BTCUSDT", "ETHUSDT", "BNBUSDT"],
                "pattern": "^[A-Z0-9]+$"
            },
        },
        "required": [],
    },
  • Tool execution registration in the MCP server's handle_call_tool method, dispatching calls to the get_token_price handler.
    case "get_token_price":
        symbol = arguments.get("symbol") if arguments else None
        try:
            data = await get_token_price(symbol=symbol)
            return [
                types.TextContent(
                    type="text",
                    text=json.dumps(data, indent=2),
                )
            ]
        except Exception as e:
            raise RuntimeError(f"Failed to fetch token price data: {e}")
  • Tool registration in the list_tools() method, defining name, description, and input schema for get_token_price.
    types.Tool(
        name="get_token_price",
        description="Get real-time token price info, supports symbol parameter",
        inputSchema={
            "type": "object",
            "properties": {
                "symbol": {
                    "type": "string",
                    "description": "Trading pair symbol in format like BTCUSDT, ETHUSDT, etc. Leave empty to get all symbols",
                    "examples": ["BTCUSDT", "ETHUSDT", "BNBUSDT"],
                    "pattern": "^[A-Z0-9]+$"
                },
            },
            "required": [],
        },
    ),
  • Supporting utility function used by get_token_price to perform authenticated HTTP requests to the Desk3 API.
    def request_api(method: str, url: str, params: dict = None, data: dict = None) -> any:
        headers = {
            'Accepts': 'application/json',
            'X-DESK3_PRO_API_KEY': API_KEY,
        }
        try:
            logging.info(f"Requesting {method.upper()} {url} params={params} data={data}")
            if method.lower() == 'get':
                response = requests.get(url, headers=headers, params=params)
            elif method.lower() == 'post':
                response = requests.post(url, headers=headers, json=data)
            else:
                raise ValueError(f"Unsupported HTTP method: {method}")
            response.raise_for_status()
            logging.info(f"Response {response.status_code} for {url}")
            return json.loads(response.text)
        except Exception as e:
            logging.error(f"Error during {method.upper()} {url}: {e}")
            raise
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It mentions 'real-time' which implies current data, but doesn't disclose behavioral traits like rate limits, data sources, update frequency, error handling, or authentication needs. For a price-fetching tool with zero annotation coverage, this leaves significant gaps in understanding how it behaves.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/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. However, it could be slightly more structured by separating the parameter note into its own clause for clarity. No wasted words, but minor room for improvement in flow.

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 no annotations, no output schema, and a simple parameter, the description is incomplete. It doesn't explain what 'price info' includes (e.g., price, volume, change), return format, or error cases. For a tool fetching financial data, more context on data scope and reliability is needed to be fully helpful.

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?

Schema description coverage is 100%, so the schema fully documents the single parameter (symbol). The description adds minimal value beyond the schema by mentioning 'supports symbol parameter' but doesn't provide additional semantics like examples of common symbols beyond what's in the schema. 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.

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: 'Get real-time token price info' specifies the action (get) and resource (token price info). It distinguishes from siblings like get_exchange_rate (likely fiat-focused) or get_token_circulating_supply (different metric). However, it doesn't explicitly differentiate from all siblings (e.g., get_mini_24hr might also provide price-related data).

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 mentions 'supports symbol parameter' but doesn't explain when to use it with or without the symbol, or when to choose other tools like get_exchange_rate for different price types. There's no context about prerequisites, timing, or sibling tool comparisons.

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/desk3/cryptocurrency-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server