Polymarket Resolution Statistics
pm_resolution_statsRetrieve statistics on Polymarket resolution data including total markets tracked, upcoming resolutions, resolution sources, and last update time.
Instructions
Get statistics about the Polymarket resolution dataset: total markets tracked, upcoming resolutions, resolution sources, and last updated. Free endpoint.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/pm_resolution.ts:159-182 (handler)Handler function for pm_resolution_stats: calls apiGet to /api/v1/pm/resolution/stats, handles errors, and returns JSON-formatted stats data. This is a free endpoint with no input schema.
async () => { const res = await apiGet<PmResolutionStatsResponse>( "/api/v1/pm/resolution/stats", ); if (!res.ok) { return { content: [ { type: "text" as const, text: `API error (${res.status}): ${JSON.stringify(res.data)}`, }, ], isError: true, }; } return { content: [ { type: "text" as const, text: JSON.stringify(res.data, null, 2) }, ], }; }, ); - src/tools/pm_resolution.ts:20-25 (schema)PmResolutionStatsResponse interface defining the response shape: dataset, source, update_frequency, and stats (Record<string, unknown>).
interface PmResolutionStatsResponse { dataset: string; source: string; update_frequency: string; stats: Record<string, unknown>; } - src/tools/pm_resolution.ts:150-157 (registration)Registration of pm_resolution_stats tool via server.registerTool with title 'Polymarket Resolution Statistics', description explaining it returns dataset statistics (free), and empty inputSchema.
server.registerTool( "pm_resolution_stats", { title: "Polymarket Resolution Statistics", description: "Get statistics about the Polymarket resolution dataset: total markets tracked, " + "upcoming resolutions, resolution sources, and last updated. Free endpoint.", inputSchema: {}, - src/index.ts:56-56 (registration)Top-level registration call: registerPmResolutionTools(server) invoked in the main server setup file.
registerPmResolutionTools(server); - src/client.ts:44-76 (helper)apiGet helper function used by the handler to make HTTP GET requests to the Verilex API.
export async function apiGet<T = unknown>( path: string, params?: Record<string, string | number | undefined>, ): Promise<ApiResponse<T>> { const url = buildUrl(path, params); const headers: Record<string, string> = { Accept: "application/json", "User-Agent": "verilex-mcp-server/0.1.0", }; // Forward x402 payment token if present in env (for paid endpoints) const paymentToken = process.env.VERILEX_PAYMENT_TOKEN; if (paymentToken) { headers["X-Payment-Token"] = paymentToken; } const res = await fetch(url, { headers }); const data = (await res.json()) as T; const stale = res.headers.get("X-Data-Stale"); const lastUpdated = res.headers.get("X-Data-Last-Updated"); const ageSeconds = res.headers.get("X-Data-Age-Seconds"); return { ok: res.ok, status: res.status, data, stale: stale === "true", lastUpdated: lastUpdated ?? undefined, ageSeconds: ageSeconds ? Number(ageSeconds) : undefined, }; }