get_token_circulating_supply
Retrieve token circulating and total supply data for cryptocurrency trading pairs to analyze market metrics and token distribution.
Instructions
Get token circulating supply and total supply information
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes | Trading pair symbol (required), format BTC -> BTCUSDT, ETH -> ETHUSDT |
Implementation Reference
- src/desk3_service/server.py:97-108 (handler)The core handler function that makes an HTTP GET request to the Desk3 API endpoint for token circulating supply data given a symbol.
async def get_token_circulating_supply(symbol: str) -> dict[str, Any]: """ Get token circulating supply and total supply information. :param symbol: Trading pair symbol (required), format BTC -> BTCUSDT, ETH -> ETHUSDT :return: Token circulating supply and total supply information """ url = 'https://mcp.desk3.io/v1/market/circulating' params = {'symbol': symbol} try: return request_api('get', url, params=params) except Exception as e: raise RuntimeError(f"Failed to fetch token circulating supply data: {e}") - src/desk3_service/server.py:578-589 (schema)JSON Schema defining the input parameters for the tool, requiring a 'symbol' string matching the pattern for trading pairs.
inputSchema={ "type": "object", "properties": { "symbol": { "type": "string", "description": "Trading pair symbol (required), format BTC -> BTCUSDT, ETH -> ETHUSDT", "examples": ["BTCUSDT", "ETHUSDT", "BNBUSDT"], "pattern": "^[A-Z0-9]+$" }, }, "required": ["symbol"], }, - src/desk3_service/server.py:575-590 (registration)Registration of the tool in the MCP server's list_tools() handler, including name, description, and schema.
types.Tool( name="get_token_circulating_supply", description="Get token circulating supply and total supply information", inputSchema={ "type": "object", "properties": { "symbol": { "type": "string", "description": "Trading pair symbol (required), format BTC -> BTCUSDT, ETH -> ETHUSDT", "examples": ["BTCUSDT", "ETHUSDT", "BNBUSDT"], "pattern": "^[A-Z0-9]+$" }, }, "required": ["symbol"], }, ), - src/desk3_service/server.py:759-772 (handler)Dispatch handler in MCP server's call_tool() that validates input, calls the core handler, formats response as JSON, and returns TextContent.
case "get_token_circulating_supply": if not arguments or "symbol" not in arguments: raise ValueError("Missing required argument: symbol") symbol = arguments["symbol"] try: data = await get_token_circulating_supply(symbol=symbol) return [ types.TextContent( type="text", text=json.dumps(data, indent=2), ) ] except Exception as e: raise RuntimeError(f"Failed to fetch token circulating supply data: {e}") - src/desk3_service/server.py:23-42 (helper)Helper function used by the handler 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