Skip to main content
Glama
ethancod1ng

Bybit MCP Server

by ethancod1ng

get_order_history

Retrieve historical trading orders from Bybit to analyze past transactions, track performance, and review trading activity across spot, linear, inverse, and option markets.

Instructions

Get historical orders

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryYes
symbolNo
limitNo

Implementation Reference

  • Core implementation of getOrderHistory that calls Bybit's getHistoricOrders API endpoint.
    async getOrderHistory(category: string, symbol?: string, limit: number = 20) {
      try {
        const response = await this.client.getHistoricOrders({
          category: category as any,
          symbol: symbol,
          limit: limit
        });
        return response;
      } catch (error) {
        throw new Error(`Failed to get order history: ${error instanceof Error ? error.message : JSON.stringify(error)}`);
      }
    }
  • Zod input schema for the get_order_history tool defining category, optional symbol and limit.
    export const OrderHistorySchema = 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)')
    });
  • src/tools.ts:78-86 (registration)
    MCP tool registration defining name, description, and input schema for get_order_history.
    {
      name: 'get_order_history',
      description: 'Get historical orders',
      inputSchema: {
        type: 'object',
        properties: OrderHistorySchema.shape,
        required: ['category']
      }
    },
  • Server-side dispatch handler that routes get_order_history calls to the client implementation.
    case 'get_order_history':
      result = await this.client.getOrderHistory(
        args.category as string,
        args.symbol as string,
        args.limit as number
      );
      break;
Behavior1/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Get historical orders' only indicates a read operation without details on permissions, rate limits, data freshness, pagination, or error handling. For a tool with 3 parameters and no annotation coverage, this is a significant gap in transparency.

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

Conciseness4/5

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

The description is a single, efficient phrase with no wasted words. It's front-loaded and easy to parse, though it could benefit from more detail given the tool's complexity. The brevity is appropriate but borders on under-specification.

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 tool has 3 parameters, 0% schema description coverage, no annotations, and no output schema, the description is incomplete. It lacks details on behavior, parameter usage, return values, and differentiation from siblings. For a historical data retrieval tool in a trading context, more context is needed to guide effective use.

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

Parameters1/5

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

Schema description coverage is 0%, meaning none of the 3 parameters (category, symbol, limit) are documented in the schema. The description adds no parameter information beyond what's implied by the tool name. It doesn't explain what 'category' refers to, how 'symbol' is used, or the meaning of 'limit' in context, failing to compensate for the schema gap.

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

Purpose3/5

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

The description 'Get historical orders' states the basic action (get) and resource (historical orders), which is clear but vague. It doesn't specify what constitutes 'historical' (e.g., completed vs. all past orders) or how it differs from sibling tools like 'get_open_orders' or 'get_24hr_ticker'. The purpose is understandable but lacks specificity for sibling differentiation.

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

Usage Guidelines2/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. It doesn't mention when to choose it over 'get_open_orders' for current orders or 'get_24hr_ticker' for recent market data, nor does it specify prerequisites like authentication or account access. Usage is implied but not explicitly defined.

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/ethancod1ng/bybit-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server