Skip to main content
Glama

get_order_history

Retrieve past trading orders on Bybit exchange to analyze performance, track transactions, and manage account activity. Filter by category, symbol, time range, or status for specific order history review.

Instructions

Get order history

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryYesCategory (spot, linear, inverse, etc.)
symbolNoSymbol (e.g., BTCUSDT)
orderIdNoOrder ID
orderLinkIdNoOrder link ID
orderFilterNoOrder filter
orderStatusNoOrder status
startTimeNoStart time in milliseconds
endTimeNoEnd time in milliseconds
limitNoNumber of orders to retrieve

Implementation Reference

  • Core handler function that constructs API parameters and calls makeBybitRequest to fetch order history from Bybit's /v5/order/history endpoint.
    async getOrderHistory( category: string, symbol?: string, orderId?: string, orderLinkId?: string, orderFilter?: string, orderStatus?: string, startTime?: number, endTime?: number, limit: number = 50 ): Promise<BybitResponse<{ list: Order[] }> | { error: string }> { const params: any = { category, limit }; if (symbol) params.symbol = symbol; if (orderId) params.orderId = orderId; if (orderLinkId) params.orderLinkId = orderLinkId; if (orderFilter) params.orderFilter = orderFilter; if (orderStatus) params.orderStatus = orderStatus; if (startTime) params.startTime = startTime; if (endTime) params.endTime = endTime; return this.makeBybitRequest('/v5/order/history', 'GET', params); }
  • Input schema definition for the get_order_history tool, registered in ListToolsRequestSchema handler, defining parameters like category, symbol, etc.
    { name: 'get_order_history', description: 'Get order history', inputSchema: { type: 'object', properties: { category: { type: 'string', description: 'Category (spot, linear, inverse, etc.)', }, symbol: { type: 'string', description: 'Symbol (e.g., BTCUSDT)', }, orderId: { type: 'string', description: 'Order ID', }, orderLinkId: { type: 'string', description: 'Order link ID', }, orderFilter: { type: 'string', description: 'Order filter', }, orderStatus: { type: 'string', description: 'Order status', }, startTime: { type: 'number', description: 'Start time in milliseconds', }, endTime: { type: 'number', description: 'End time in milliseconds', }, limit: { type: 'number', description: 'Number of orders to retrieve', default: 50, }, }, required: ['category'], },
  • src/index.ts:848-868 (registration)
    MCP tool dispatch/registration in the CallToolRequestSchema switch statement, mapping tool call to BybitService.getOrderHistory execution and response formatting.
    case 'get_order_history': { const result = await this.bybitService.getOrderHistory( typedArgs.category, typedArgs.symbol, typedArgs.orderId, typedArgs.orderLinkId, typedArgs.orderFilter, typedArgs.orderStatus, typedArgs.startTime, typedArgs.endTime, typedArgs.limit ); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }

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