Skip to main content
Glama
ethancod1ng

Bybit MCP Server

by ethancod1ng

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
NameRequiredDescriptionDefault
symbolNo

Implementation Reference

  • 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)}`); } }
  • 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;

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/ethancod1ng/bybit-mcp-server'

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