Polymarket Dataset Statistics
pm_statsRetrieve Polymarket dataset statistics: total markets, wallets tracked, volume, and last updated timestamp. Free endpoint.
Instructions
Get statistics about the Polymarket dataset: total markets, wallets tracked, volume, and last updated timestamp. Free endpoint.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/pm.ts:267-297 (handler)The handler function for the 'pm_stats' tool. Calls apiGet to fetch stats from '/api/v1/pm/stats' and returns the JSON response.
server.registerTool( "pm_stats", { title: "Polymarket Dataset Statistics", description: "Get statistics about the Polymarket dataset: total markets, wallets tracked, " + "volume, and last updated timestamp. Free endpoint.", inputSchema: {}, }, async () => { const res = await apiGet<PmStatsResponse>("/api/v1/pm/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.ts:269-274 (schema)Input/output schema for pm_stats. No input parameters (empty inputSchema). Response type defined by PmStatsResponse interface (dataset, source, update_frequency, stats).
{ title: "Polymarket Dataset Statistics", description: "Get statistics about the Polymarket dataset: total markets, wallets tracked, " + "volume, and last updated timestamp. Free endpoint.", inputSchema: {}, - src/tools/pm.ts:22-27 (schema)PmStatsResponse interface defining the shape of the stats response (dataset, source, update_frequency, stats).
interface PmStatsResponse { dataset: string; source: string; update_frequency: string; stats: Record<string, unknown>; } - src/tools/pm.ts:265-298 (registration)Registration of 'pm_stats' tool via server.registerTool with description stating it's a free endpoint.
// ── Dataset stats ───────────────────────────────────────────────────── server.registerTool( "pm_stats", { title: "Polymarket Dataset Statistics", description: "Get statistics about the Polymarket dataset: total markets, wallets tracked, " + "volume, and last updated timestamp. Free endpoint.", inputSchema: {}, }, async () => { const res = await apiGet<PmStatsResponse>("/api/v1/pm/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/client.ts:44-50 (helper)The apiGet helper function used by the pm_stats 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> = {