Skip to main content
Glama
TeacherLi07

htx-mcp

by TeacherLi07

HTX Get Trade History

htx_get_trade_history
Read-onlyIdempotent

Retrieve executed-fill history for a spot or swap instrument to reconcile orders, calculate realized entry/exit prices and fees, or review execution quality. Use an order ID or page through time-bounded trade fills.

Instructions

Return compact executed-fill history for one instrument, not order history.

Traders normally review fills to reconcile an order, calculate realized entry/exit prices and fees, or inspect recent execution quality. Provide order_id for reconciliation; otherwise use a bounded time window and cursor to page a recent instrument history. The exchange retention window is 48 hours for spot and legacy swaps, and three days for v5 swaps.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum normalized fills to return (1-100).
cursorNoOpaque cursor from the previous result. Omit on the first page.
productYesHTX product family: spot or USDT-margined perpetual swap.
end_timeNoOptional inclusive millisecond end time for a paged history query.
order_idNoOptional exchange order ID. When supplied, return fills for that order rather than a paged instrument history.
directionNoPage direction: prev returns older records and next advances from a cursor.prev
instrumentYesSpot symbol such as 'btcusdt' or swap contract such as 'BTC-USDT'.
start_timeNoOptional inclusive millisecond start time for a paged history query.
include_rawNoWhen true, include the original HTX envelopes in addition to compact normalized data.
margin_modeNoSwap margin mode: isolated or cross.isolated

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.7.3

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, and non-destructive behavior. The description adds useful behavioral context beyond that: it switches modes based on order_id versus time-window paging, returns compact normalized data by default, and discloses the 48-hour/3-day retention window. No contradiction with annotations.

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?

Three sentences with no filler. The opening sentence states the core scope and exclusion, the middle sentence grounds usage in trader workflows, and the final sentence provides the retention constraint. Every sentence earns its place.

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

Completeness5/5

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

Despite having 10 parameters, the schema fully documents each one and an output schema exists. The description covers the two key decision paths (order_id versus paged history), the retention limitations, and the distinction from order history. Nothing critical for correct invocation is missing.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3. The description adds meaningful semantics by explaining that order_id selects reconciliation mode, that cursor is for paging instrument history, that time windows should be bounded, and that 'compact' output contrasts with include_raw. This goes beyond the schema's individual parameter descriptions.

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 uses a specific verb ('Return') and resource ('executed-fill history for one instrument'), and immediately clarifies it is 'not order history.' This clearly distinguishes the tool from order-history or broader reconciliation tools among the siblings.

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?

It gives concrete usage conditions: provide order_id for reconciliation, otherwise use a bounded time window with cursor pagination for recent instrument history. It also names trader workflows and retention windows, though it does not explicitly name a sibling alternative for order-history lookups, so it falls just short of full alternative routing.

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

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/TeacherLi07/htx-mcp'

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