PolyTest
Read historical Polymarket crypto Up/Down market data: prices, snapshots, and order books.
¿Debería usar esto?
Calidad y seguridad
Hallazgos (2)
- HIGH
- MEDIUMen polytest_get_market
Basado en el análisis automatizado de las definiciones de herramientas y el cumplimiento del protocolo.
Costo de contexto
Este es el número aproximado de tokens que se consumen cada vez que las herramientas del servidor se cargan en el contexto de un modelo. Los recuentos más altos reducen la atención disponible para otras tareas.
Instalar
Instalación con un clic
Agrega esto a tu archivo `claude_desktop_config.json`:
{
"mcpServers": {
"mcp": {
"command": "npx",
"args": [
"@polytest/mcp"
]
}
}
}Paquetes ejecutables
0.2.0stdioPuntos de conexión remotos
https://mcp.polytest.io/mcpstreamable-httpQué puede hacer
Inventario de herramientas
Herramientas (5)
🟢polytest_list_markets(market_type, coin, start_time, end_time, limit, ...)
Lists Up/Down markets of one market_type for one coin. Use it to find a market_id before reading snapshots or a price series. Returns market rows, newest first by start time, each with its window, opening and closing spot price, winner, volume, and status. Use status, not winner, to tell whether a market is still running. coin is btc, eth, or sol, and 4hr and 24hr markets exist for btc only. start_time and end_time filter on the market start time. PolyTest loads new markets in batches, and note says so when the newest market is hours old. Costs 1 API request. To continue, call again with offset set to next_offset while stop is "more". stop "tier_window" means the plan does not cover the requested markets. If truncated is true, rows were cut to keep the result small and next_offset points at the first cut row.
Esquema de entrada
{
"type": "object",
"properties": {
"market_type": {
"type": "string",
"enum": [
"5m",
"15m",
"1hr",
"4hr",
"24hr"
],
"description": "Window length. One of 5m, 15m, 1hr, 4hr, 24hr."
},
"coin": {
"description": "Coin symbol in lowercase: btc, eth, or sol. 4hr and 24hr markets exist for btc only.",
"default": "btc",
"type": "string"
},
"start_time": {
"description": "ISO 8601. Keeps markets that start at or after this time. No zone means UTC.",
"type": "string"
},
"end_time": {
"description": "ISO 8601. Keeps markets that start at or before this time. No zone means UTC.",
"type": "string"
},
"limit": {
"default": 20,
"description": "Rows per page.",
"type": "integer",
"minimum": 1,
"maximum": 100
},
"offset": {
"default": 0,
"description": "Rows to skip. Pass next_offset from the previous page.",
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"market_type"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}Esquema de salida
{
"type": "object",
"properties": {
"markets": {
"type": "array",
"items": {
"type": "object",
"properties": {
"market_id": {
"type": "string"
},
"slug": {
"type": "string"
},
"market_type": {
"type": "string"
},
"coin": {
"type": "string"
},
"start_time": {
"type": "string"
},
"end_time": {
"type": "string"
},
"price_start": {
"description": "Coin spot price when the window opened.",
"type": [
"number",
"null"
]
},
"price_end": {
"description": "Coin spot price when the window closed. Null until it is recorded.",
"type": [
"number",
"null"
]
},
"winner": {
"description": "Winning side once the market resolves. A tie resolves Up.",
"type": [
"string",
"null"
]
},
"final_volume": {
"type": [
"number",
"null"
]
},
"resolved_at": {
"type": [
"string",
"null"
]
},
"status": {
"type": "string",
"enum": [
"upcoming",
"open",
"resolved",
"ended_no_result"
],
"description": "upcoming: not started. open: the window is still running. resolved: the winner is known. ended_no_result: the window closed and PolyTest has no result for it."
}
},
"required": [
"market_id",
"slug",
"market_type",
"coin",
"start_time",
"end_time",
"price_start",
"price_end",
"winner",
"final_volume",
"resolved_at",
"status"
],
"additionalProperties": false
}
},
"count": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "Rows in this result."
},
"stop": {
"type": "string",
"enum": [
"more",
"end",
"tier_window"
]
},
"next_offset": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "Offset of the next page when stop is more."
},
"truncated": {
"type": "boolean",
"description": "True when rows were cut to keep the result small."
},
"note": {
"type": "string"
}
},
"required": [
"markets",
"count",
"stop",
"next_offset",
"truncated"
],
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false
}🟢polytest_get_market(market_id, slug)
Returns one market by market_id or by slug. Pass exactly one of them. A slug is the last path segment of a Polymarket event URL, as in https://polymarket.com/event/<slug>, and the whole URL works too. Use it to resolve a Polymarket link or to read the full record of a market, including token ids and resolution fields. Costs 1 API request.
Esquema de entrada
{
"type": "object",
"properties": {
"market_id": {
"description": "PolyTest market id. Pass this or slug, not both.",
"type": "string"
},
"slug": {
"description": "A Polymarket event URL, or its last path segment. Pass this or market_id, not both.",
"type": "string"
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema"
}Esquema de salida
{
"type": "object",
"properties": {
"market": {
"type": "object",
"properties": {
"market_id": {
"type": "string"
},
"slug": {
"type": "string"
},
"market_type": {
"type": "string"
},
"coin": {
"type": "string"
},
"start_time": {
"type": "string"
},
"end_time": {
"type": "string"
},
"price_start": {
"description": "Coin spot price when the window opened.",
"type": [
"number",
"null"
]
},
"price_end": {
"description": "Coin spot price when the window closed. Null until it is recorded.",
"type": [
"number",
"null"
]
},
"winner": {
"description": "Winning side once the market resolves. A tie resolves Up.",
"type": [
"string",
"null"
]
},
"final_volume": {
"type": [
"number",
"null"
]
},
"resolved_at": {
"type": [
"string",
"null"
]
},
"status": {
"type": "string",
"enum": [
"upcoming",
"open",
"resolved",
"ended_no_result"
],
"description": "upcoming: not started. open: the window is still running. resolved: the winner is known. ended_no_result: the window closed and PolyTest has no result for it."
},
"event_id": {
"type": "string"
},
"final_liquidity": {
"type": [
"number",
"null"
]
},
"condition_id": {
"type": [
"string",
"null"
]
},
"clob_token_up": {
"type": [
"string",
"null"
]
},
"clob_token_down": {
"type": [
"string",
"null"
]
},
"created_at": {
"type": [
"string",
"null"
]
},
"updated_at": {
"type": [
"string",
"null"
]
}
},
"required": [
"market_id",
"slug",
"market_type",
"coin",
"start_time",
"end_time",
"price_start",
"price_end",
"winner",
"final_volume",
"resolved_at",
"status",
"event_id",
"final_liquidity",
"condition_id",
"clob_token_up",
"clob_token_down",
"created_at",
"updated_at"
],
"additionalProperties": false
}
},
"required": [
"market"
],
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false
}🟢polytest_get_snapshots(market_id, start_time, end_time, limit, offset, ...)
Returns snapshots of one market, oldest first. Each row has time, spot_price, price_up, and price_down. Use it for tick detail in a short time range. For the shape of a whole market, use polytest_get_price_series. A market has about 8 snapshots per second, so narrow the range with start_time and end_time. With include_orderbook each row also has the Up and Down order books, cut to orderbook_depth levels per side, and a page holds at most 20 rows. The book at one moment is this tool with start_time set to that moment, limit 1, and include_orderbook true. Costs 1 API request. To continue, call again with offset set to next_offset while stop is "more". stop "snapshot_offset_cap" means offsets end at 100000, so move start_time forward to continue. If truncated is true, rows were cut to keep the result small and next_offset points at the first cut row.
Esquema de entrada
{
"type": "object",
"properties": {
"market_id": {
"type": "string",
"description": "PolyTest market id from polytest_list_markets or polytest_get_market."
},
"start_time": {
"description": "ISO 8601. Keeps snapshots at or after this time. No zone means UTC.",
"type": "string"
},
"end_time": {
"description": "ISO 8601. Keeps snapshots at or before this time. No zone means UTC.",
"type": "string"
},
"limit": {
"default": 50,
"description": "Rows per page. At most 20 with order books.",
"type": "integer",
"minimum": 1,
"maximum": 200
},
"offset": {
"default": 0,
"description": "Rows to skip. Pass next_offset from the previous page.",
"type": "integer",
"minimum": 0,
"maximum": 100000
},
"include_orderbook": {
"default": false,
"description": "Adds the Up and Down order books to each row.",
"type": "boolean"
},
"orderbook_depth": {
"default": 5,
"description": "Price levels kept per side of each book.",
"type": "integer",
"minimum": 1,
"maximum": 25
}
},
"required": [
"market_id"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}Esquema de salida
{
"type": "object",
"properties": {
"market_id": {
"type": "string"
},
"snapshots": {
"type": "array",
"items": {
"type": "object",
"properties": {
"time": {
"type": "string"
},
"spot_price": {
"description": "Coin spot price.",
"type": [
"number",
"null"
]
},
"price_up": {
"description": "Lowest ask on the Up order book, 0 to 1: what buying Up cost at that moment. Null when nobody was selling Up.",
"type": [
"number",
"null"
]
},
"price_down": {
"description": "Lowest ask on the Down order book, 0 to 1: what buying Down cost at that moment. Null when nobody was selling Down. Up and Down asks usually add up to a little more than 1.",
"type": [
"number",
"null"
]
},
"orderbook_up": {
"anyOf": [
{
"type": "object",
"properties": {
"bids": {
"type": "array",
"items": {
"type": "object",
"properties": {
"price": {
"type": "number"
},
"size": {
"type": "number"
}
},
"required": [
"price",
"size"
],
"additionalProperties": false
},
"description": "Best bid first."
},
"asks": {
"type": "array",
"items": {
"type": "object",
"properties": {
"price": {
"type": "number"
},
"size": {
"type": "number"
}
},
"required": [
"price",
"size"
],
"additionalProperties": false
},
"description": "Best ask first."
}
},
"required": [
"bids",
"asks"
],
"additionalProperties": false
},
{
"type": "null"
}
]
},
"orderbook_down": {
"anyOf": [
{
"type": "object",
"properties": {
"bids": {
"type": "array",
"items": {
"type": "object",
"properties": {
"price": {
"type": "number"
},
"size": {
"type": "number"
}
},
"required": [
"price",
"size"
],
"additionalProperties": false
},
"description": "Best bid first."
},
"asks": {
"type": "array",
"items": {
"type": "object",
"properties": {
"price": {
"type": "number"
},
"size": {
"type": "number"
}
},
"required": [
"price",
"size"
],
"additionalProperties": false
},
"description": "Best ask first."
}
},
"required": [
"bids",
"asks"
],
"additionalProperties": false
},
{
"type": "null"
}
]
}
},
"required": [
"time",
"spot_price",
"price_up",
"price_down"
],
"additionalProperties": false
}
},
"count": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "Rows in this result."
},
"stop": {
"type": "string",
"enum": [
"more",
"end",
"tier_window",
"snapshot_offset_cap"
]
},
"next_offset": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "Offset of the next page when stop is more."
},
"truncated": {
"type": "boolean",
"description": "True when rows were cut to keep the result small."
},
"note": {
"type": "string"
}
},
"required": [
"market_id",
"snapshots",
"count",
"stop",
"next_offset",
"truncated"
],
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false
}🟢polytest_get_limits
Returns the plan behind the current credential, an API key or a signed-in account: tier, rate limits, concurrency cap, data access, key cap, and trial budget. data_access gives how many of the most recent markets of each type the plan can read. A null cap means no cap. trial_budget is what a free trial may use in total over its 3 days. It applies only during a trial and does not show how much is left. Use it before a large read or after a plan or rate limit error. Costs 1 API request.
Esquema de entrada
{
"type": "object",
"properties": {},
"$schema": "https://json-schema.org/draft/2020-12/schema"
}Esquema de salida
{
"type": "object",
"properties": {
"tier": {
"type": "string"
},
"rate_limits": {
"type": "object",
"properties": {
"requests_per_minute": {
"type": "number"
},
"burst_per_second": {
"type": "number"
}
},
"required": [
"requests_per_minute",
"burst_per_second"
],
"additionalProperties": false
},
"concurrency": {
"type": "object",
"properties": {
"max_concurrent": {
"type": [
"number",
"null"
]
}
},
"required": [
"max_concurrent"
],
"additionalProperties": false
},
"data_access": {
"type": "object",
"properties": {
"5m_markets": {
"type": [
"number",
"null"
]
},
"15m_markets": {
"type": [
"number",
"null"
]
},
"1hr_markets": {
"type": [
"number",
"null"
]
},
"4hr_markets": {
"type": [
"number",
"null"
]
},
"24hr_markets": {
"type": [
"number",
"null"
]
},
"snapshots_per_market": {
"type": [
"number",
"null"
]
}
},
"required": [
"5m_markets",
"15m_markets",
"1hr_markets",
"4hr_markets",
"24hr_markets",
"snapshots_per_market"
],
"additionalProperties": false
},
"api_keys": {
"type": "object",
"properties": {
"max_active": {
"type": [
"number",
"null"
]
}
},
"required": [
"max_active"
],
"additionalProperties": false
},
"trial_budget": {
"type": "object",
"properties": {
"requests": {
"type": "number"
},
"records": {
"type": "number"
},
"bytes": {
"type": "number"
}
},
"required": [
"requests",
"records",
"bytes"
],
"additionalProperties": false
}
},
"required": [
"tier",
"rate_limits",
"concurrency",
"data_access",
"api_keys",
"trial_budget"
],
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false
}🟢polytest_get_price_series(market_id, samples, start_time, end_time)
Returns evenly spaced price points across one market, oldest first. Use it to see the shape of a market without paging through snapshots. It splits the market window, or the part of it inside start_time and end_time, into samples equal buckets and returns the first snapshot of each bucket. Each point has time, spot_price, price_up, and price_down. empty_buckets counts the buckets with no snapshot, and note says where the data ends when the last buckets are empty. For a market still running, the range stops at the current time. Costs 1 + samples API requests, which is 21 with the default. The result is complete and has no paging. For more detail, raise samples or call polytest_get_snapshots on a short range.
Esquema de entrada
{
"type": "object",
"properties": {
"market_id": {
"type": "string",
"description": "PolyTest market id from polytest_list_markets or polytest_get_market."
},
"samples": {
"default": 20,
"description": "Number of buckets. Each one costs 1 API request.",
"type": "integer",
"minimum": 2,
"maximum": 60
},
"start_time": {
"description": "ISO 8601. Start of the range. Defaults to the market start. No zone means UTC.",
"type": "string"
},
"end_time": {
"description": "ISO 8601. End of the range. Defaults to the market end. No zone means UTC.",
"type": "string"
}
},
"required": [
"market_id"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}Esquema de salida
{
"type": "object",
"properties": {
"market_id": {
"type": "string"
},
"start_time": {
"type": "string",
"description": "Start of the sampled range."
},
"end_time": {
"type": "string",
"description": "End of the sampled range."
},
"bucket_seconds": {
"type": "number",
"description": "Length of each bucket in seconds."
},
"points": {
"type": "array",
"items": {
"type": "object",
"properties": {
"time": {
"type": "string"
},
"spot_price": {
"description": "Coin spot price.",
"type": [
"number",
"null"
]
},
"price_up": {
"description": "Lowest ask on the Up order book, 0 to 1: what buying Up cost at that moment. Null when nobody was selling Up.",
"type": [
"number",
"null"
]
},
"price_down": {
"description": "Lowest ask on the Down order book, 0 to 1: what buying Down cost at that moment. Null when nobody was selling Down. Up and Down asks usually add up to a little more than 1.",
"type": [
"number",
"null"
]
}
},
"required": [
"time",
"spot_price",
"price_up",
"price_down"
],
"additionalProperties": false
}
},
"empty_buckets": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "Buckets that had no snapshot."
},
"requests_used": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "API requests this call made, retries included."
},
"note": {
"type": "string"
}
},
"required": [
"market_id",
"start_time",
"end_time",
"bucket_seconds",
"points",
"empty_buckets",
"requests_used"
],
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false
}Comunidad
Evidencia