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. Returns preview_id (valid 30 s) 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 forhyperliquid
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
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
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 within 30 seconds
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
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. Added

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, and the description reinforces this with "sending nothing" while adding genuinely new behavior: the preview_id is valid only 30 seconds, which explains the non-idempotent, ephemeral nature of the call. It does not detail what happens on a failed check or what the caller must do if the preview expires, so it stops short of a 5.

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 the purpose and the safety qualifier, then usage, then the parameter recipe, then the return and next step — a sensible order with no filler sentences. The telegraphic fragment style in the entry-styles clause ("market, nothing; limit, ...") is dense but slightly cryptic on first read.

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?

For a 16-parameter order-preview tool with an output schema, the description covers the essential pieces: validation scope, required inputs per entry style, the ephemeral preview_id, and the handoff to execute_previewed_order. Remaining gaps (what a failing check returns, how to refresh an expired preview) are modest given the output schema exists.

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 coverage is 94%, so per-parameter meaning is largely already documented. The description's real contribution is cross-parameter combination rules by entry style (market needs nothing; limit needs order_type "limit" plus price; a waiting entry uses trigger_price; a ladder uses order_type "limit" plus ladder_prices), which the schema states only partially and scattered per property. This is above a pure baseline but not exhaustive across all 16 parameters.

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". This clearly separates it from execute_previewed_order and from close_position without needing 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 when-to-use rule ("Use before every new position"), an explicit when-not with a named alternative ("Not for closing (use close_position)"), and the required follow-up call ("Next: execute_previewed_order(preview_id)"). The workflow position of the tool is fully determined.

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