preview_order
Use this BEFORE place_order whenever the user wants to open a position: it validates and sizes the order (fresh est. entry, size after rounding, est. liquidation, TP/SL sanity, MCP caps) WITHOUT placing anything, and shows a proposal card the user can confirm from. Read-only and always safe to call. It also says what the account still needs before place_order can go through (agent trading off, no approved trading agent, or the one-time platform-fee approval): relay that to the user and wait for them instead of calling place_order. If the user confirms, call place_order with the same arguments.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"symbol": "<symbol>",
"side": "<side>",
"margin_usd": "<margin_usd>"
},
"name": "preview_order"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| side | Yes | Position direction | |
| symbol | Yes | Hyperliquid perp coin symbol, e.g. BTC, ETH, SOL (not BTCUSDT) | |
| leverage | No | Leverage multiplier | |
| stop_loss | No | Stop-loss trigger price | |
| margin_usd | Yes | USDC margin to commit. Position notional = margin × leverage | |
| order_type | No | Execution type | market |
| limit_price | No | Required when order_type is limit | |
| margin_mode | No | Margin mode | cross |
| take_profit | No | Take-profit trigger price |