Skip to main content
Glama

Preview a perpetual futures order

preview_order
Read-only

Check a perpetual futures order and its stop-loss against the permissions, limits and price band, sending nothing. Use before every new position. Not for closing (use close_position). Every order: symbol, side, size_base (from size_position) and a stop. Entry styles add: market, nothing; limit, order_type "limit" and price; at a price, trigger_price; ladder, order_type "limit" and ladder_prices. A market entry may carry worst_price, and then valid_seconds up to 120. Returns preview_id (valid 30 s unless longer) and every check. Next: execute_previewed_order(preview_id).

Input Schema

NameRequiredDescriptionDefault
sideYesbuy = open or add to a long, sell = open or add to a short
priceNoLimit price, USD per coin (limit orders only)
venueNoVenue: sandbox, hyperliquid, okx, bybit or binance. Omitted: the agent's only venue, else hyperliquid if connected, else your only connected exchange, else the sandbox; or "best": the cheapest all-in venue (price plus fee) you may use and have the margin for
reasonNoOptional: why, in your words (up to 500 characters). The person sees it on the approval card and in history; other agents never do
symbolYesBase coin, e.g. BTC
leverageNoLeverage, e.g. 5 (the default); size_position's preview_args carries one your limits allow
oco_withNoOptional, for an entry that waits (trigger_price or a limit order): the request_id (req_…) of another waiting entry of yours, a trigger entry or an unfilled limit order, on any symbol or venue. One cancels the other: once either opens, the rest of the group is withdrawn (e.g. a buy above resistance or a sell below support)
size_baseYesSize in the base coin (BTC, not USD); rounded down to the venue step. Get it from size_position
stop_lossNoRequired stop-loss, USD per coin: below entry for buys, above for sells. Or give stop_distance_pct
hold_hoursNoOptional: how long you expect to hold, in hours, to see funding and the round trip's cost (and, with venue "best", to choose by them)
order_typeNomarket
take_profitNoOptional take-profit, USD per coin
worst_priceNoOptional, market entries: the worst price it may fill at, USD per coin (above the mark for buys, below for sells). Execution is refused once the mark is past it, and never fills beyond it
ladder_pricesNoOptional ladder entry: 2-5 limit prices, size_base split evenly across them, one stop-loss beyond all of them (stop_distance_pct counts from the farthest price); order_type limit, no price
trigger_priceNoOptional: hold the order and open it at market only when the mark reaches this price (a breakout or a pullback), re-checked then; market orders only. Risk is computed from this price
valid_secondsNoHow long the preview stays valid: 30 (the default), or up to 120 with worst_price, for a person or a slow model to decide
stop_distance_pctNoOr the stop as a distance from the entry (trigger price, limit price or mark), 0.02 = 2%
trigger_valid_hoursNoWith trigger_price: hours it waits before lapsing, 1-168 (default 24)

Output Schema

NameRequiredDescriptionDefault
okYesTrue: every check passed
legsNoA ladder entry: [{price, size_base}] per limit leg, USD per coin and in the base coin (e.g. BTC), not USD
sideYesbuy or sell
venueYesVenue name
checksYesEvery check that ran, all pass
symbolYesBase coin
risk_usdYesLoss if the stop fills, USD
size_baseYesSize after rounding down to the venue step, in the base coin (e.g. BTC), not USD (the same name as the input)
expires_atYesISO 8601 UTC
fee_sourceNoaccount (your own rate), published (the base rate) or none (sandbox)
margin_usdYesMargin needed, USD
mark_priceYesMark at preview time, USD per coin
preview_idYesPass to execute_previewed_order before expires_at
deprecationNoPresent only while this tool is deprecated: replacement, removal_date, changelog
est_fee_usdNoTrading fee for this order, USD: taker rate for market orders, maker for limit; the exit pays a fee too
worst_priceNoWith worst_price: the bound, USD per coin; it never fills beyond it
fee_rate_bpsNoThe rate used, basis points of notional
notional_usdYessize_base x entry, USD
venue_choiceNoWith venue "best": why this venue (all-in price and the alternatives)
trigger_priceNoA trigger entry: opens at market only when the mark reaches this, USD per coin
est_fill_priceNoMarket orders: average fill if executed now against the book, USD per coin; null for limit orders or when the book is too thin to say
est_funding_usdNoWith hold_hours: funding over that time at today's rate, USD; negative = received
est_slippage_bpsNoest_fill_price against mark_price in basis points, positive = worse; a market order never fills beyond the price band
requires_approvalYesTrue: execute_previewed_order will wait for a person's approval
trigger_valid_hoursNoA trigger entry: hours it waits before lapsing
est_round_trip_cost_usdNoWith hold_hours: entry fee, exit fee at the taker rate and that funding, USD

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • removedInput schema / properties / venue / default
      Removed value: -"hyperliquid"
  2. Changed4 schema fields changed
    • addedInput schema / properties / valid_seconds
      Added value: +{
      +  "default": 30,
      +  "description": "How long the preview stays valid: 30 (the default), or up to 120 with worst_price, for a person or a slow model to decide",
      +  "maximum": 120,
      +  "minimum": 30,
      +  "type": "integer"
      +}
    • addedInput schema / properties / worst_price
      Added value: +{
      +  "description": "Optional, market entries: the worst price it may fill at, USD per coin (above the mark for buys, below for sells). Execution is refused once the mark is past it, and never fills beyond it",
      +  "exclusiveMinimum": 0,
      +  "type": [
      +    "number",
      +    "null"
      +  ]
      +}
    • changedOutput schema / properties / preview_id / description
      Previous value: -"Pass to execute_previewed_order within 30 seconds"New value: +"Pass to execute_previewed_order before expires_at"
    • addedOutput schema / properties / worst_price
      Added value: +{
      +  "description": "With worst_price: the bound, USD per coin; it never fills beyond it",
      +  "type": [
      +    "number",
      +    "null"
      +  ]
      +}
  3. Added

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false; the description reinforces this with "sending nothing" and adds behavior the annotations do not carry: the returned preview_id expires in 30 s by default (extendable to 120 s only with worst_price), and nothing is committed until execute_previewed_order is called. That validity window is the single most consequential behavior for correct invocation and it is disclosed plainly.

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?

Front-loaded with purpose and the no-side-effects guarantee, then a compact entry-style breakdown, then the next step — nothing is padding. The telegraphic phrasing ("market, nothing; limit, order_type \"limit\" and price") is slightly clipped and takes a second read, which is the only reason it is not a 5.

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?

For an 18-parameter, open-world, multi-venue preview tool, the description covers the required fields, the entry-style branches, the stop alternatives, the validity window, and the handoff to execution. An output schema exists, so return values need not be enumerated, and the one return value that matters for sequencing (preview_id) is named anyway.

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

Parameters5/5

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

Schema coverage is already 94%, so the baseline is 3, but the description goes well beyond it by mapping parameter sets to entry styles (market = no extra fields; limit = order_type "limit" plus price; at-a-price = trigger_price; ladder = order_type "limit" plus ladder_prices) and by tying worst_price to the extended valid_seconds ceiling. These conditional dependencies across 18 parameters are the main source of misuse and the description addresses them directly.

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 ("Check a perpetual futures order and its stop-loss against the permissions, limits and price band") plus the crucial scope qualifier "sending nothing." It explicitly separates itself from close_position and points to execute_previewed_order as the follow-on, so an agent can place it in the workflow without opening any 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 explicit when-to-use ("Use before every new position"), explicit when-not ("Not for closing (use close_position)"), and an explicit next step ("Next: execute_previewed_order(preview_id)"). It also enumerates which parameter combinations each entry style requires, which is guidance an agent cannot infer from the schema alone.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources