Skip to main content
Glama

gdex_replay_trade

Read-only

Replay a Hyperliquid perpetual trade from account records to verify submissions, fills, close reasons, fees, funding, net realized P&L, and whether the position is flat with TP/SL orders cleared.

Instructions

Private, verified replay of a Hyperliquid perp trade from the account's own records: what the agent submitted (local journal), what filled, why it closed (order history), fees incl. the GDEX builder fee, funding, net realized P&L, and whether the position is flat and linked TP/SL orders are gone (fresh reads). Missing data is reported as unknown, never guessed. "Replay my last trade" → latest: true. If several trades match without latest/closeId, returns candidates: ask the user which. Read-only: cannot place or cancel anything.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "gdex_replay_trade"
  }
}

Input Schema

NameRequiredDescriptionDefault
coinNoOnly trades in this market, e.g. ETH or xyz:TSLA
latestNoReplay the most recent trade
closeIdNoA specific trade from the candidates list
accountRefNoFrom gdex_connect; may be omitted when exactly one account is connected
lookbackDaysNoHow far back to read fills (default 30)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv5.4.1

TDQS

A4.4/5.0
Behavior4/5

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

Beyond readOnlyHint and openWorldHint, the description discloses the data provenance (local journal, order history, fresh reads) and the crucial honesty guarantee that missing data is reported as unknown rather than guessed. It also reiterates that it cannot place or cancel anything, which is consistent with the annotations. It stops short of noting latency, rate limits, or freshness windows for the 'fresh reads'.

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?

It is a single dense paragraph that front-loads the purpose before the invocation hints and the read-only caveat; nearly every clause carries information. The one weakness is density — the return-field enumeration is crammed into the opening sentence rather than being broken out.

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?

There is no output schema, so the description carries the burden of describing what comes back, and it does so field by field (fills, close reason, fees, funding, net P&L, flat state, TP/SL linkage). For a five-parameter, zero-required diagnostic tool this is complete enough to call correctly.

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, but the description adds real meaning: it ties 'latest: true' to the natural-language request and explains the candidate-list/closeId relationship, which the schema alone only hints at with 'A specific trade from the candidates list'.

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 states a specific verb and resource ('replay of a Hyperliquid perp trade') and enumerates exactly what is reconstructed: submitted order, fill, close reason, fees including the GDEX builder fee, funding, net realized P&L, and flat/TP-SL state. It is clearly a single-trade forensics tool, not a history lister, which separates it from siblings like get_hl_trade_history.

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 an explicit triggering utterance ('Replay my last trade' → latest: true) and prescribes what to do when several trades match without latest/closeId: return candidates and ask the user. What is missing is any direct routing statement against a named alternative such as get_hl_trade_history for bulk listing or gdex_positions for current state.

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

Deploy Server

Other Tools