Skip to main content
Glama
ymylive
by ymylive

get_consolidated_orderbook

Fetch L2 order books from multiple exchanges in parallel and merge into one virtual book to identify the best bid and ask across the market, with each level attributed to its source exchange for per-venue liquidity analysis.

Instructions

Fetch L2 order books from many exchanges in parallel and merge into one virtual book.

Answers "where is the best bid/ask across the whole market?" — more useful than per-venue get_orderbook for execution analysis. The merged book does NOT aggregate by price level; each level retains its source exchange so the LLM can attribute liquidity per venue.

Args: symbol: CCXT unified symbol (e.g. "BTC/USDT"). Some exchanges may reject the symbol (BadSymbol) — those go into exchanges_error. exchange_ids: Comma-separated CCXT exchange IDs (capped at 10). depth: Levels per side per exchange, clamped to [1, 50].

Returns: Object with: - symbol, depth_per_exchange - exchanges_ok: list of exchange ids that responded - exchanges_error: list of {exchange, error} for failures - bids: merged bids sorted by price desc, capped at depth*len(ok), each entry {price, amount, exchange} - asks: merged asks sorted by price asc, capped likewise - best_bid, best_ask: top of merged book with attribution - spread_bps: (best_ask - best_bid) / mid * 10000

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolNoBTC/USDT
exchange_idsNobinance,okx,bybit,kraken,bitstamp
depthNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so the description bears full responsibility. It discloses that the tool fetches in parallel, caps exchange_ids at 10, clamps depth to [1,50], does not aggregate by price level, and details the return structure including error handling for failed exchanges. This is comprehensive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is fairly long but well-structured with a purpose statement, usage hint, args block, and returns block. Every sentence adds value. Minor redundancy (explicitly listing args in a separate block) but overall efficient for the tool's complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers all aspects: purpose, when to use, parameter details, return format, error handling. Given the tool's parallelism and merging logic, the description provides enough context for correct selection and invocation. Output schema exists, so return details are appropriate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It explains each parameter: symbol (CCXT unified format, example), exchange_ids (comma-separated, capped at 10, default), depth (levels per side, clamped, default). This adds meaning beyond the schema's defaults and types.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Describes the tool as fetching L2 order books from multiple exchanges in parallel and merging them into one virtual book. It explicitly differentiates from the sibling tool `get_orderbook` by stating it is 'more useful than per-venue get_orderbook for execution analysis', and explains that the merged book retains source exchange information for liquidity attribution.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Clearly states the use case: answering 'where is the best bid/ask across the whole market'. It contrasts with `get_orderbook` and provides guidance on when to use this tool instead. Also mentions that some exchanges may reject the symbol, handling errors in `exchanges_error`.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ymylive/coin-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server