Skip to main content
Glama

get_orderbook

Retrieve real-time orderbook data for a specific cryptocurrency symbol on Bybit exchange. Specify the category (spot, linear, inverse) and symbol to access bid and ask prices with customizable depth for informed trading decisions.

Instructions

Get orderbook data for a specific symbol

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryYesCategory (spot, linear, inverse, etc.)
limitNoNumber of orderbook entries to retrieve
symbolYesSymbol (e.g., BTCUSDT)

Implementation Reference

  • Core handler function that executes the tool logic by calling Bybit's /v5/market/orderbook API endpoint via makeBybitRequest.
    async getOrderbook(category: string, symbol: string, limit: number = 50): Promise<BybitResponse<OrderbookData> | { error: string }> { return this.makeBybitRequest('/v5/market/orderbook', 'GET', { category, symbol, limit }); }
  • Input schema definition for the get_orderbook tool, specifying parameters category, symbol (required), and optional limit.
    inputSchema: { type: 'object', properties: { category: { type: 'string', description: 'Category (spot, linear, inverse, etc.)', }, symbol: { type: 'string', description: 'Symbol (e.g., BTCUSDT)', }, limit: { type: 'number', description: 'Number of orderbook entries to retrieve', default: 50, }, }, required: ['category', 'symbol'], },
  • src/index.ts:722-736 (registration)
    Tool call dispatcher/registration in the CallToolRequestSchema handler that invokes the BybitService.getOrderbook method and formats the response.
    case 'get_orderbook': { const result = await this.bybitService.getOrderbook( typedArgs.category, typedArgs.symbol, typedArgs.limit ); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
  • src/index.ts:63-85 (registration)
    Tool registration in the ListTools response, including name, description, and input schema.
    { name: 'get_orderbook', description: 'Get orderbook data for a specific symbol', inputSchema: { type: 'object', properties: { category: { type: 'string', description: 'Category (spot, linear, inverse, etc.)', }, symbol: { type: 'string', description: 'Symbol (e.g., BTCUSDT)', }, limit: { type: 'number', description: 'Number of orderbook entries to retrieve', default: 50, }, }, required: ['category', 'symbol'], }, },
  • TypeScript interface defining the structure of the orderbook response data.
    export interface OrderbookData { symbol: string; bids: [string, string][]; asks: [string, string][]; ts: number; u: number; }

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/kondisettyravi/mcp-bybit-node'

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