Skip to content

Method - get_order_book

Bid/ask snapshot. Uses OrderBookFactorytemporary subscription if the book is not already open for that symbol.


Contract (arguments)

ArgumentRequiredDefaultNotes
exchangeyes
marketyesspot or futures
symbolyes
depthno20Levels per side, 1–1000
syncTimeoutSecondsno20Wait for sync, 5–120

Response shape

OrderBookSnapshotDto: available, optional message, best_bid, best_ask, bids[], asks[] with price and quantity.


Example tools/call

json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_order_book",
    "arguments": {
      "exchange": "Binance",
      "market": "spot",
      "symbol": "BTCUSDT",
      "depth": 5,
      "syncTimeoutSeconds": 20
    }
  }
}

Example success (fragment)

json
{
  "available": true,
  "best_bid": { "price": 98230.12, "quantity": 1.234 },
  "best_ask": { "price": 98230.45, "quantity": 0.987 },
  "bids": [{ "price": 98230.12, "quantity": 1.234 }],
  "asks": [{ "price": 98230.45, "quantity": 0.987 }]
}

← MCP overview