Skip to main content
Glama
bybit-exchange

Bybit MCP Server

Official

getSpreadOrderHistory

Query historical spread trading orders to review past activity, reconcile trades, or analyze execution across both legs, with flexible filtering by order ID or time range.

Instructions

Query historical spread trading orders including filled, cancelled, and rejected orders.

Usage Scenarios:

  • Review past spread trading activity for reconciliation.

  • Look up a specific historical order by orderId or orderLinkId.

  • Query orders within a specific time range (max 7-day window).

  • Analyze spread order execution across both legs.

Time Range Logic:

  • Neither startTime nor endTime: returns last 7 days of history.

  • startTime only: returns data from startTime to startTime + 7 days.

  • endTime only: returns data from endTime - 7 days to endTime.

  • Both provided: endTime - startTime must be <= 7 days.

Important:

  • orderId and orderLinkId take precedence over time-based filtering.

  • Fully cancelled orders are stored for up to 24 hours only.

Agent hint: GET endpoint requiring authentication. All parameters are optional. orderId and orderLinkId take priority over time filters. Time range is limited to 7 days max. Fully cancelled orders are retained for only 24 hours. Response includes both-leg details (leg1/leg2 fields).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolNo
baseCoinNo
orderIdNo
orderLinkIdNo
startTimeNo
endTimeNo
limitNo
cursorNo
Behavior4/5

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

With no annotations, the description carries full burden. It discloses time range logic (7-day window, precedence of orderId/orderLinkId), retention policy (cancelled orders stored 24h), authentication requirement, and response contents (both-leg details). Lacks explicit mention of pagination or rate limits.

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 well-structured with sections (Usage Scenarios, Time Range Logic, Important) and an agent hint. It is front-loaded with the main action, and every sentence adds value without redundancy.

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

Completeness4/5

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

Given 8 params, no output schema, and no annotations, the description covers core behavior well: purpose, filtering rules, special cases, and response hint. It is mostly complete but omits details on pagination (cursor/limit) and the role of symbol/baseCoin.

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 0%, so description must add meaning. It explains key parameters: orderId/orderLinkId precedence, startTime/endTime behavior. However, it does not describe symbol, baseCoin, limit, or cursor explicitly, though the agent hint mentions 'All parameters are optional'.

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

Purpose5/5

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

The description clearly states the tool's purpose: 'Query historical spread trading orders including filled, cancelled, and rejected orders.' It differentiates from siblings like 'getOrderHistory' (regular orders) and 'getSpreadOpenOrders' (open orders) by focusing on historical spread orders.

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

Usage Guidelines4/5

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

The description provides explicit usage scenarios: review past activity, look up by ID, query within time range. It implies when to use this tool over alternatives (e.g., for spread orders vs. regular orders) but does not explicitly state when not to use it.

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/bybit-exchange/trading-mcp'

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