Skip to main content
Glama

Historical order book depth

get_order_book_history

Fetch historical full L2 order book depth for a Polymarket market, showing bid and ask ladders at selected time intervals to reconstruct past liquidity.

Instructions

Full L2 bid and ask ladders over time for a market — every price level and the size resting at each. This is data Polymarket does not archive: its /book endpoint returns only the current state, so depth exists only where it was captured live.

One thing to expect when reading the results: binary markets go one-sided as they resolve. In the final minute of a 5-minute market most snapshots have an empty bid or ask side, because nobody offers the losing outcome. That is real market behaviour rather than missing data, so guard before indexing the first level of a ladder.

Responses are large. Keep the window narrow or the resolution coarse: a one-hour window at 1s is 3,600 buckets per token, and a market has two tokens.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoBuckets per page, default 50. Use the returned next_cursor to page.
cursorNonext_cursor from a previous response
end_tsYesISO-8601 UTC, e.g. 2026-08-23T14:00:00Z
start_tsYesISO-8601 UTC, e.g. 2026-08-23T14:00:00Z
id_or_slugYesMarket slug, e.g. btc-updown-5m-1787551200
resolutionNoDefaults to 1m. Use 1s only for short windows.
Behavior4/5

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

With no annotations provided, the description carries the full disclosure burden and does it well: it warns that binary markets go one-sided near resolution (empty bid/ask is real market behavior, not missing data), that depth exists only where it was captured live, and that responses are large (a one-hour window at 1s yields 3,600 buckets per token across two tokens). No contradiction with annotations; it omits authentication, rate limits, and explicit side-effect statements, but otherwise is strong.

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 structured into three crisp paragraphs — what it returns, a data-quality caveat, and an operational size warning — with the core purpose front-loaded. Every sentence pulls its weight; even the data-architecture note ('exists only where it was captured live') explains why the data can be sparse without adding redundancy. It is longer than one sentence but earned length.

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

Completeness4/5

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

The description conveys the essential shape of the data (price levels and resting sizes), its most surprising behavioral trait (one-sided resolution), and directly actionable guidance for choosing a window and resolution. The only real gap is that, with no output schema present, the description does not spell out the exact JSON/bucket structure of a snapshot; likewise pagination/phrasing is left to the schema's next_cursor reference, but for a read-only depth-history tool the coverage is otherwise impressively thorough.

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 description coverage is 100%, with defaults and examples for every parameter (e.g., one-hour window at 1s, resolution default 1m, cursor use), so the schema is already solid. 3100% schema description coverage means the description doesn't need to repeat parameter details; the description adds valuable cross-parameter trade-off reasoning: 1s only for short windows, and concrete bucket-count math for a given resolution/window. That raises it above the baseline of 3.

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

Purpose4/5

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

The description names a completely new resource — 'Full L2 bid and ask ladders over time' with every price level and resting size — and pairs it with a specific verb, so an agent knows it retrieves historical depth snapshots, not current price. It does not explicitly route the agent away from sibling tools like get_price_history or get_market, so it falls slightly short of full sibling differentiation.

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

Usage Guidelines3/5

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

The description implies when the tool is the right choice ('This is data Polymarket does not archive: its /book endpoint returns only the current state') and hence when its output is needed beyond live data sources. It gives no explicit 'when not to use' or pointers to siblings (get_price_history, get_market), so tool-selection guidance is inferred rather than stated.

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/polyorderbooks/mcp-server'

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