AI Agents & MCP

How to Preview a Crypto Order Through MCP Before Execution

Use quote_trade_order_preview to validate and display an order without sending it. Read the current tool schema, use an allowed payment currency, and run a new preview whenever the order changes.

20 minutesIntermediateAI-agent developers and trading-operations teams

What you will accomplish

  • Create one complete order preview
  • Check symbol, quantity, notional, and leverage before approval
  • Present a compact human-readable confirmation
  • Keep preview separate from execution

Before you begin

  • A connected Quote.Trade MCP client
  • Current exchange information for the selected symbol
  • Server-side limits for allowed markets and maximum USD order value
USD price, collateral currency, and network

Prices and order values are shown in USD. The collateral currency, such as USDC or USDT, and its blockchain network are separate settings. Check the live account and market settings for allowed currencies, minimum size, and leverage.

Preview effectLocal validation only; no API call
Price / notionalUSD quote terms
Payment currencySeparate supported stablecoin field
Execution certaintyNone; preview does not reserve liquidity
Step-by-step

Read the current input fields

Call tools/list and use the exact fields returned by the connected server. If the live input fields differ from the example, stop and update the integration before continuing.

Validate market and account inputs separately

Use current market metadata for symbol status and quantity precision. Use account or funding configuration for permitted paymentCurrency. Do not infer USDC or USDT from quoteAsset=USD.

Call the preview tool

Use values validated against current account, market, and live tools/list data. The preview does not reserve liquidity, submit an API order, or return a request hash.

json
{
  "jsonrpc": "2.0",
  "id": 11,
  "method": "tools/call",
  "params": {
    "name": "quote_trade_order_preview",
    "arguments": {
      "account": 222,
      "symbol": "BTC",
      "side": "BUY",
      "price": 60000.0,
      "quantity": 0.001,
      "paymentCurrency": "USDT"
    }
  }
}
Expected result

A response with willSend=false, the complete request body, estimatedNotional in USD terms, and risk-check results.

Show the final order clearly

Show the account, market, side, amount, USD price, estimated USD order value, payment currency, leverage setting, risk-check results, and a clear statement that no order was sent.

text
Market: BTC
Side: BUY
Quantity: 0.001 BTC
Price: 60,000.00 USD
Estimated notional: 60.00 USD
Payment currency: USDT
Order sent: No

Create a new preview after any order change

Store the exact preview fields in your own application state. Any change to the account, symbol, side, amount, price, payment currency, order type, leverage, or server-side limits requires a new preview and approval.

Troubleshooting

Common problems and fixes

The preview tool rejects a symbol

Refresh instruments or exchange information and use the exact current symbol.

Notional cannot be calculated

Ensure quantity and price are numeric; estimated notional is quantity multiplied by the USD price. Validate paymentCurrency separately and do not guess a missing price.

The preview differs from the user’s request

Stop. Show the discrepancy and rebuild the draft before requesting approval.

The user changes leverage after approval

Invalidate the approval, re-preview, and request a new confirmation.

Primary sources

Ready for the next step?

Review trading controls

Review trading controls