Skip to main content
Glama

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
NameRequiredDescriptionDefault
categoryYesCategory (spot, linear, inverse, etc.)
symbolNoSymbol (e.g., BTCUSDT)
orderIdNoOrder ID
orderLinkIdNoOrder link ID
orderFilterNoOrder filter
limitNoNumber of orders to retrieve

Implementation Reference

  • 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); }
  • 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'], }, },
  • 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'], },

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