Skip to main content
Glama

get_mini_24hr

Retrieve real-time 24-hour mini ticker data for cryptocurrency trading pairs using the symbol parameter. Supports individual symbols like BTCUSDT or fetches all pairs if unspecified. Ideal for monitoring market trends.

Instructions

Get 24-hour mini ticker 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

  • Primary handler function that implements the core logic for the get_mini_24hr tool by making an API request to the Desk3 market mini/24hr endpoint.
    async def get_mini_24hr(symbol: str | None = None) -> list[dict[str, Any]]: """ Get 24-hour mini ticker information. :param symbol: Trading pair, comma separated for multiple, return all if not provided :return: Mini ticker info array """ url = 'https://mcp.desk3.io/v1/market/mini/24hr' params = {} if symbol: params['symbol'] = symbol try: return request_api('get', url, params=params) except Exception as e: raise RuntimeError(f"Failed to fetch mini 24hr data: {e}")
  • JSON schema defining the input parameters for the get_mini_24hr tool (optional 'symbol' string).
    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": [], },
  • Registration of the get_mini_24hr tool in the server's list_tools() handler, specifying name, description, and input schema.
    types.Tool( name="get_mini_24hr", description="Get 24-hour mini ticker 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": [], },
  • MCP protocol handler in server.call_tool() that dispatches calls to get_mini_24hr and formats the JSON response.
    case "get_mini_24hr": symbol = arguments.get("symbol") if arguments else None try: data = await get_mini_24hr(symbol=symbol) return [ types.TextContent( type="text", text=json.dumps(data, indent=2), ) ] except Exception as e: raise RuntimeError(f"Failed to fetch mini 24hr data: {e}")
  • Shared helper function used by get_mini_24hr (and other tools) to make 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

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