get-volume-history
Retrieve historical trading volume data for cryptocurrency pairs to analyze market activity and liquidity trends over time.
Instructions
Get trading volume history over time
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"symbol": "<symbol>"
},
"name": "get-volume-history"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes | Trading pair symbol (e.g., BTC/USDT, ETH/USDT) | |
| days | No | Number of days of volume history (default: 7, max: 30) | |
| exchange | No | Exchange to use (supported: binance, coinbase, kraken, kucoin, hyperliquid, huobi, bitfinex, bybit, okx, mexc) | binance |
Implementation Reference
- src/server.py:338-358 (handler)Handler implementation for the 'get-volume-history' tool. Fetches daily OHLCV data, extracts and formats volume history over the specified number of days.
elif name == "get-volume-history": symbol = arguments.get("symbol", "").upper() days = min(int(arguments.get("days", 7)), 30) # Get daily volume data since = int((datetime.now() - timedelta(days=days)).timestamp() * 1000) ohlcv = await exchange.fetch_ohlcv(symbol, "1d", since=since) volume_data = [] for candle in ohlcv: timestamp, _, _, _, _, volume = candle dt = datetime.fromtimestamp(timestamp/1000).strftime('%Y-%m-%d') volume_data.append(f"{dt}: {volume:,.2f}") return [ types.TextContent( type="text", text=f"Daily trading volume history for {symbol} on {exchange_id.upper()}:\n\n" + "\n".join(volume_data) ) ] - src/server.py:200-220 (registration)Registration of the 'get-volume-history' tool in the @server.list_tools() handler, including description and input schema.
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"], }, ), - src/server.py:203-219 (schema)Input schema definition for the 'get-volume-history' tool, specifying required 'symbol' and optional 'days' and 'exchange' parameters.
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"], },