get_orderbook
Retrieve the order book (bids and asks) for a trading pair on supported exchanges to analyze market depth and liquidity.
Instructions
Get the order book (bids and asks) for a symbol on an exchange
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| exchange | Yes | Exchange name: pacifica, hyperliquid, or lighter | |
| symbol | Yes | Trading pair symbol, e.g. BTC, ETH, SOL |
Implementation Reference
- src/mcp-server.ts:108-124 (handler)The "get_orderbook" tool is registered here. It takes 'exchange' and 'symbol' as parameters and calls 'adapter.getOrderbook(symbol)'.
server.tool( "get_orderbook", "Get the order book (bids and asks) for a symbol on an exchange", { exchange: z.string().describe("Exchange name: pacifica, hyperliquid, or lighter"), symbol: z.string().describe("Trading pair symbol, e.g. BTC, ETH, SOL"), }, async ({ exchange, symbol }) => { try { const adapter = await getOrCreateAdapter(exchange); const book = await adapter.getOrderbook(symbol); return { content: [{ type: "text", text: ok(book, { exchange, symbol }) }] }; } catch (e) { return { content: [{ type: "text", text: err(e instanceof Error ? e.message : String(e), { exchange, symbol }) }], isError: true }; } }, );