Method - get_order_book
Bid/ask snapshot. Uses OrderBookFactory — temporary subscription if the book is not already open for that symbol.
Contract (arguments)
| Argument | Required | Default | Notes |
|---|---|---|---|
exchange | yes | — | |
market | yes | — | spot or futures |
symbol | yes | — | |
depth | no | 20 | Levels per side, 1–1000 |
syncTimeoutSeconds | no | 20 | Wait 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 }]
}