Skip to main content
Glama
bybit-exchange

Bybit MCP Server

Official

getOrderHistory

Read-only

Retrieve historical orders from Bybit with filters for category, symbol, and time range. Order data may lag; for real-time, use the open order endpoint or WebSocket stream.

Instructions

Query order history. As order creation/cancellation is asynchronous, the data returned from this endpoint may delay. To get real-time order information, you could query the open order endpoint or rely on the websocket stream (recommended).

  • Unified account covers: Spot / USDT perpetual / USDC contract / Inverse contract / Options

  • Classic account covers: Spot / USDT perpetual / Inverse contract

Rules:

  • Last 7 days: supports querying all closed statuses except "Cancelled", "Rejected", "Deactivated"

  • Last 24 hours: supports querying "Cancelled", "Rejected", "Deactivated" orders

  • Beyond 7 days: only supports querying orders with final filled statuses (Filled, PartiallyFilledCanceled)

Time range rules:

  • Without both startTime and endTime: returns last 7 days by default

  • Only startTime provided: returns from startTime to startTime + 7 days

  • Only endTime provided: returns from endTime - 7 days to endTime

  • Both provided: endTime - startTime must be ≤ 7 days

Agent hint: TradFi: use category=spot for xStock order history, category=linear for equity/commodity perpetual order history.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
cursorNo
symbolNo
endTimeNo
orderIdNo
baseCoinNo
categoryYes
startTimeNo
settleCoinNo
orderFilterNoOrder
orderLinkIdNo
orderStatusNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.1.20
    • addedInput schema / properties / orderFilter / default
      Added value: +"Order"
  2. First observedv2.1.11

TDQS

A4.3/5.0
Behavior5/5

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

Annotations already mark this as read-only and open-world, and the description goes well beyond them by disclosing asynchronous delay, closed-status query rules by time window, and the exact 7-day range arithmetic. This is rich behavioral context that materially changes how the agent should interpret results.

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 dense but every section earns its place: the async caveat, account coverage, status rules, time-range rules, and agent hint all affect how the tool is called and interpreted. It is well-structured with clear headings and front-loaded with the most important operational caveat.

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

Completeness3/5

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

For a 12-parameter tool with no output schema and no parameter descriptions, the description covers the most invocation-critical rules well, including time windows, statuses, and account types. However, it does not clarify pagination/cursor behavior, the meaning of orderFilter values, or what the returned history contains, leaving meaningful gaps for an agent to resolve.

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?

With 0% schema description coverage, the description carries the burden for parameter meaning. It compensates well for startTime/endTime and category, including explicit time-window rules and the TradFi category hint, but it leaves limit, cursor, symbol, orderId, baseCoin, settleCoin, orderFilter, orderLinkId, and orderStatus with no added explanation.

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

Purpose4/5

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

The description opens with 'Query order history', a clear verb+resource statement, and adds account-type coverage and status limitations that sharpen the scope. It does not explicitly contrast itself with sibling order-history tools like getOrderList or getTradeHistory, so it stops short of full differentiation.

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

Usage Guidelines5/5

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

The description explicitly tells the agent when not to rely on this endpoint: 'To get real-time order information, you could query the open order endpoint or rely on the websocket stream (recommended).' It also provides an agent-specific mapping of TradFi categories to spot/linear, giving concrete selection guidance.

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