Skip to main content
Glama

get_open_orders

Retrieve open orders from Bybit exchange by specifying category, symbol, or order ID. Manage and monitor active trades effectively with customizable filters and limits for precise order tracking.

Instructions

Get open orders

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryYesCategory (spot, linear, inverse, etc.)
limitNoNumber of orders to retrieve
orderFilterNoOrder filter
orderIdNoOrder ID
orderLinkIdNoOrder link ID
symbolNoSymbol (e.g., BTCUSDT)

Implementation Reference

  • MCP tool handler case for 'get_open_orders'. Extracts arguments from request, calls BybitService.getOpenOrders, stringifies the result as JSON, and returns it in the MCP response format.
    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), }, ], }; }
  • Input schema definition for the get_open_orders tool, defining parameters like category (required), symbol, order IDs, filter, and limit with descriptions and types.
    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:692-692 (registration)
    The tool is registered in the MCP server's tools list via this.server.setTools(), making it available for invocation. The specific entry includes name, description, and inputSchema.
    }));
  • Core implementation in BybitService: constructs parameters and makes authenticated GET request to Bybit API endpoint '/v5/order/realtime' to fetch open orders.
    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); }

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