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),
          },
        ],
      };
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden for behavioral disclosure. 'Get order history' implies a read-only operation but doesn't specify authentication requirements, rate limits, pagination behavior (the limit parameter suggests pagination but isn't explained), or what happens when no orders match criteria. For a tool with 9 parameters and no annotation coverage, this is insufficient behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise at just three words. While this represents under-specification rather than ideal conciseness, according to the scoring framework, 'Process' received a 2 for being under-specified, but this description is similarly minimal. However, it does front-load the core purpose without wasted words, earning maximum points for conciseness despite lacking substance.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (9 parameters, trading domain), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what the tool returns, authentication requirements, error conditions, or how it differs from sibling order-related tools. For a tool that retrieves historical trading data with multiple filtering options, this minimal description leaves too many contextual gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all 9 parameters thoroughly. The description adds no parameter information beyond what's in the schema. According to scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no param info in description, which applies here.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get order history' is a tautology that restates the tool name without adding specificity. It doesn't clarify what 'order history' means in this context (e.g., historical orders vs. recent orders, which user's orders, what time range). While the verb 'Get' is clear, the resource 'order history' is vague without distinguishing from sibling tools like get_open_orders or get_tickers.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. There are multiple sibling tools related to orders (get_open_orders, cancel_order, place_order) and trading data (get_tickers, get_orderbook), but the description offers no context about when this specific order history retrieval is appropriate versus those other tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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