get_open_orders
Retrieve active orders from Bybit trading accounts to monitor positions and manage trades across spot, linear, inverse, and option markets.
Instructions
Get list of open/active orders
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| category | Yes | ||
| symbol | No | ||
| limit | No |
Implementation Reference
- src/client.ts:97-108 (handler)Core handler function that executes the tool logic by calling Bybit API's getActiveOrders.async getOpenOrders(category: string, symbol?: string, limit: number = 20) { try { const response = await this.client.getActiveOrders({ category: category as any, symbol: symbol, limit: limit }); return response; } catch (error) { throw new Error(`Failed to get open orders: ${error instanceof Error ? error.message : JSON.stringify(error)}`); } }
- src/server.ts:92-98 (handler)Server dispatch handler that routes the 'get_open_orders' tool call to the client implementation.case 'get_open_orders': result = await this.client.getOpenOrders( args.category as string, args.symbol as string, args.limit as number ); break;
- src/tools.ts:69-77 (registration)Tool registration defining name, description, and input schema reference.{ name: 'get_open_orders', description: 'Get list of open/active orders', inputSchema: { type: 'object', properties: OpenOrdersSchema.shape, required: ['category'] } },
- src/types.ts:68-72 (schema)Zod schema for input validation of get_open_orders parameters.export const OpenOrdersSchema = z.object({ category: z.enum(['spot', 'linear', 'inverse', 'option']).describe('Product type'), symbol: z.string().optional().describe('Trading symbol'), limit: z.number().min(1).max(50).optional().describe('Number of records to return (default: 20)') });