get_open_orders
Retrieve active trading orders from Bybit exchange to monitor positions, manage trades, and track execution status across various categories and symbols.
Instructions
Get open orders
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| category | Yes | Category (spot, linear, inverse, etc.) | |
| symbol | No | Symbol (e.g., BTCUSDT) | |
| orderId | No | Order ID | |
| orderLinkId | No | Order link ID | |
| orderFilter | No | Order filter | |
| limit | No | Number of orders to retrieve |
Implementation Reference
- src/bybit-service.ts:366-380 (handler)Core handler function implementing the get_open_orders tool by constructing API parameters and calling the Bybit /v5/order/realtime endpoint via makeBybitRequest.async getOpenOrders( category: string, symbol?: string, orderId?: string, orderLinkId?: string, orderFilter?: string, 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; return this.makeBybitRequest('/v5/order/realtime', 'GET', params); }
- src/index.ts:870-887 (handler)MCP CallToolRequest handler that receives tool arguments, calls BybitService.getOpenOrders, and formats the response as MCP content.case 'get_open_orders': { const result = await this.bybitService.getOpenOrders( typedArgs.category, typedArgs.symbol, typedArgs.orderId, typedArgs.orderLinkId, typedArgs.orderFilter, typedArgs.limit ); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
- src/index.ts:350-384 (registration)Tool registration in the ListTools response, defining the name, description, and input schema for get_open_orders.{ name: 'get_open_orders', description: 'Get open orders', 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', }, limit: { type: 'number', description: 'Number of orders to retrieve', default: 50, }, }, required: ['category'], }, },
- src/index.ts:353-383 (schema)JSON schema defining the input parameters for the get_open_orders tool, including required 'category' and optional filters.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', }, limit: { type: 'number', description: 'Number of orders to retrieve', default: 50, }, }, required: ['category'], },