Skip to main content
Glama

trade_preview

Validate order size, TIF, risk limits and margin impact read-only before executing a trade; returns fill estimate, fees, position, and refusal codes with remediation.

Instructions

Preview a trade WITHOUT executing. Runs trade_execute's pre-send checks read-only (size parse, order validation incl. TIF, quarantine, local risk limits — never forced) and reports any refusal as valid:false with its code + remediation; also returns the estimated fill price from the book, notional, margin impact, the builder fee the order would carry, and the existing position. Venue trading fees are NOT estimated. ALWAYS call this before trade_execute and show the result to the user for confirmation. Hyperliquid: native perps only (HIP-3 dexes via the CLI --dex).

Input Schema

NameRequiredDescriptionDefault
tifNoLimit orders: GTC (default) | IOC | FOK | ALO (post-only); venue aliases GTT / GTX / TOB accepted — checked like trade_execute
sideYesOrder side
sizeYesOrder size (base currency units, e.g., '0.1' for 0.1 BTC)
priceNoLimit price (required for limit orders)
symbolYesTrading symbol (e.g., BTC, ETH, SOL)
exchangeYesExchange: pacifica, hyperliquid, lighter, aster, lighter-rh, ondo, arcus, qfex, risex, txflow (aliases accepted)
orderTypeNoOrder typemarket
reduceOnlyNoReduce-only order (close position only) — checked like trade_execute (quarantine applies only to non-reduce-only orders)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.17.0
    • changedInput schema / properties / exchange / description
      Previous value: -"Exchange: pacifica, hyperliquid, lighter, aster, lighter-rh, ondo, arcus, qfex (aliases accepted)"New value: +"Exchange: pacifica, hyperliquid, lighter, aster, lighter-rh, ondo, arcus, qfex, risex, txflow (aliases accepted)"
  2. Changed1 schema field changedv0.15.0
    • changedInput schema / properties / exchange / description
      Previous value: -"Exchange: pacifica, hyperliquid, lighter, aster, lighter-rh, ondo, arcus, qfex, risex (aliases accepted)"New value: +"Exchange: pacifica, hyperliquid, lighter, aster, lighter-rh, ondo, arcus, qfex (aliases accepted)"
  3. Changed3 schema fields changedv0.14.3
    • changedInput schema / properties / exchange / description
      Previous value: -"Exchange: pacifica, hyperliquid, lighter, or aster"New value: +"Exchange: pacifica, hyperliquid, lighter, aster, lighter-rh, ondo, arcus, qfex, risex (aliases accepted)"
    • addedInput schema / properties / reduceOnly
      Added value: +{
      +  "default": false,
      +  "description": "Reduce-only order (close position only) — checked like trade_execute (quarantine applies only to non-reduce-only orders)",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / tif
      Added value: +{
      +  "description": "Limit orders: GTC (default) | IOC | FOK | ALO (post-only); venue aliases GTT / GTX / TOB accepted — checked like trade_execute",
      +  "type": "string"
      +}
  4. Changed1 schema field changedv0.3.12
    • changedInput schema / properties / exchange / description
      Previous value: -"Exchange: pacifica, hyperliquid, or lighter"New value: +"Exchange: pacifica, hyperliquid, lighter, or aster"
  5. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations the description carries the full burden and does so: it discloses that checks run read-only, that risk limits are "never forced," that refusals surface as valid:false with code + remediation, and that venue trading fees are NOT estimated. It also names exactly what is returned (fill price, notional, margin impact, builder fee, existing position).

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 key constraint (preview, no execution) is front-loaded, followed by the parity guarantee, the return payload, the negative caveat, and the mandatory-workflow instruction. No sentence is filler, though the middle sentence is dense.

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 correctly enumerates the return payload itself, plus refusal semantics and venue limitations. Nothing an agent needs to decide to call it or interpret the result is missing.

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 100%, so all eight parameters are already documented, and the description adds little parameter-specific meaning beyond echoing that TIF and reduce-only are "checked like trade_execute" — which the schema already says. Baseline 3 is appropriate when the schema does the heavy lifting.

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?

States a specific verb and resource ("Preview a trade") and immediately negates the failure mode ("WITHOUT executing"), which cleanly separates it from the sibling trade_execute. An agent can pick it without opening the schema.

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?

Gives an explicit imperative: "ALWAYS call this before trade_execute and show the result to the user for confirmation," which names the alternative and the ordering constraint. It also scopes the tool by venue ("Hyperliquid: native perps only, HIP-3 dexes via the CLI --dex").

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