get_24hr_ticker
Retrieve 24-hour trading statistics for Bybit cryptocurrency symbols to analyze market performance and price movements.
Instructions
Get 24-hour trading statistics for symbols
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | No |
Implementation Reference
- src/client.ts:62-72 (handler)The core handler function for the get_24hr_ticker tool. It uses the Bybit RestClientV5 to fetch 24-hour ticker statistics for the given symbol (optional).async get24hrTicker(symbol?: string) { try { const response = await this.client.getTickers({ category: 'spot', symbol: symbol }); return response; } catch (error) { throw new Error(`Failed to get 24hr ticker: ${error instanceof Error ? error.message : JSON.stringify(error)}`); } }
- src/types.ts:41-43 (schema)Zod schema defining the input parameters for the get_24hr_ticker tool: optional symbol.export const TickerSchema = z.object({ symbol: z.string().optional().describe('Trading symbol (if not provided, returns all symbols)') });
- src/tools.ts:42-50 (registration)MCP Tool registration object for get_24hr_ticker, including name, description, and input schema reference.{ name: 'get_24hr_ticker', description: 'Get 24-hour trading statistics for symbols', inputSchema: { type: 'object', properties: TickerSchema.shape, required: [] } },
- src/server.ts:77-79 (registration)Switch case in handleToolCall that registers and dispatches the get_24hr_ticker tool call to the client handler.case 'get_24hr_ticker': result = await this.client.get24hrTicker(args.symbol as string); break;