Skip to main content
Glama

Polymarket Orderbook

polymarket_orderbook
Read-onlyIdempotent

Order-book snapshot for ONE Polymarket outcome token: the nearest full-book snapshot at or before ts (the latest when omitted), flattened to price levels. token_id is the ERC-1155 OUTCOME token id (decimal string from clob_token_ids in polymarket_market_detail or outcomes[].token_id in polymarket_markets); a condition_id (0x...) will NOT work. Returns rows {as_of_ts (epoch ms, the snapshot actually used), side ('ask' | 'bid'), level (1 = best), price (probability in [0, 1]), size (shares)}, all asks before all bids. A book can be one-sided, so fewer than 2 x depth rows is normal. Each (side, level) appears once. as_of_ts can be old for a quiet or finished market, so check it before quoting a spread. [] means no snapshot at or before ts, or a token that was never recorded.

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": {
      "token_id": "<token_id>"
    },
    "name": "polymarket_orderbook"
  }
}

Input Schema

NameRequiredDescriptionDefault
tsNoAs-of epoch MILLISECONDS; the nearest snapshot at or before it is used. Omit for the latest.
depthNoLevels per side, 1 to 25 (default 25).
token_idYesRequired. The outcome token id (decimal string).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already cover safety (readOnly, idempotent, non-destructive), and the description goes well beyond them: it discloses row shape, ordering (all asks before all bids), one-sided books producing fewer than 2 x depth rows, uniqueness of (side, level), and that as_of_ts may be old for quiet or finished markets. It even defines the empty-array meaning.

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?

Front-loaded with the core purpose in the first clause, and every sentence carries information an agent needs. It is a dense single block, though; the return-row spec would be easier to scan if separated from the addressing caveats.

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?

With no output schema, the description fully carries the return contract (fields, units, ordering, empty case, staleness caveat) for a read-only, three-parameter tool. An agent can call this correctly and interpret the result without opening anything else.

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 adds real meaning: token_id's identifier domain (ERC-1155 outcome token, condition_id rejected) and ts semantics as a nearest-at-or-before lookup whose result may differ from the requested time. Depth is only referenced indirectly via the '2 x depth' row remark.

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+resource+scope: an order-book snapshot for exactly ONE outcome token, flattened to price levels. It immediately distinguishes itself from trade-based or market-metadata siblings by naming the unit (price levels per side) and the token-addressing constraint.

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

Usage Guidelines4/5

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

Gives explicit prerequisites and routing: the token_id must come from `clob_token_ids` in polymarket_market_detail or `outcomes[].token_id` in polymarket_markets, and a condition_id will not work. It also warns to check staleness before quoting a spread. It stops short of naming a direct alternative for related needs (e.g. trades or candles), so it is clear context without explicit exclusions.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.