Skip to main content
Glama

get_order_book

Read-only

Fetch live L2 bids and asks for a coin, and optionally simulate a sized market order to see average fill, worst price, slippage %, and unfilled amount before large entries or exits.

Instructions

Get the live L2 order book for one coin: levels [bids, asks], up to 20 each, every level {px, sz, n orders}. Give size (in coins) or notional_usd, not both, to also walk the book for a market order of that size: average fill, worst price, slippage % and any unfilled amount; is_buy picks the side (default buy). Use before a large entry or exit to judge slippage. For the mid price alone use get_market. Read-only; needs no key. Returns {coin, time, levels}, or {book, impact: {avg_fill_px, worst_px, slippage_pct, filled_usd, unfilled_usd, book_exhausted}} when a size is given; an unknown coin returns {error}.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "coin": "<coin>"
    },
    "name": "get_order_book"
  }
}

Input Schema

NameRequiredDescriptionDefault
coinYesCoin: a main-dex perp by name (BTC, ETH) or a HIP-3 perp as dex:SYMBOL (xyz:GOLD, xyz:BRENTOIL).
sizeNoOrder size in coins to simulate (or use notional_usd).
is_buyNoSide of the simulated order (default true: buy).
notional_usdNoOrder size in USD to simulate (or use size).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.6.1

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=true; the description adds auth context ('needs no key'), the depth cap of 20 levels per side, and both response shapes including the impact block. It also discloses error behavior for an unknown coin, which nothing in the structured data covers.

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?

Dense and front-loaded — capability, then simulation semantics, then usage guidance, then return shapes — with no filler sentences. It is a single run-on paragraph, so structure is packed rather than clean, but nothing is redundant.

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?

There is no output schema, and the description fully compensates by spelling out both return shapes and the error case. For a 4-parameter read tool with one required field, an agent has everything needed to call it correctly and interpret the result.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description earns more: it clarifies units (size in coins vs notional_usd in USD), asserts they are mutually exclusive, and explains that supplying either triggers the extra book-walk rather than just changing the query. That behavioral coupling is meaningfully beyond the per-field text.

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?

States a specific verb and resource ('Get the live L2 order book for one coin') plus the depth limit and per-level shape {px, sz, n orders}. It explicitly names the sibling it is not ('For the mid price alone use get_market'), so an agent can route without opening either schema.

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?

Gives an explicit usage context ('Use before a large entry or exit to judge slippage') and an explicit alternative with its selecting condition (get_market for the mid price alone). It also states a mutual-exclusion rule — supply size or notional_usd, not both — which is guidance the schema cannot express.

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