Polymarket Orderbook
polymarket_orderbookOrder-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. A level can repeat in one answer (the recorder writes several identical snapshot rows for one venue timestamp): keep one row per (side, level) and read a side's depth as its highest level, never as a row count. 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
| Name | Required | Description | Default |
|---|---|---|---|
| ts | No | As-of epoch MILLISECONDS; the nearest snapshot at or before it is used. Omit for the latest. | |
| depth | No | Levels per side, 1 to 25 (default 25). | |
| token_id | Yes | Required. The outcome token id (decimal string). |