Polymarket Resolution Calendar
pm_resolution_calendarRetrieve upcoming Polymarket resolution events with dates, sources, and prices. Set a lookahead period and result limit to track market resolutions.
Instructions
Get upcoming market resolution events. Shows markets expected to resolve within a given timeframe with resolution dates, sources, and current prices. Cost: $0.02 per query. Source: Polymarket resolution tracking.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | Number of days to look ahead (default 7) | |
| limit | No | Maximum results (default 25) |
Implementation Reference
- src/tools/pm_resolution.ts:116-146 (handler)The async handler function for the pm_resolution_calendar tool. It calls the API endpoint /api/v1/pm/resolution/calendar with days and limit parameters, then formats the response.
async ({ days, limit }) => { const res = await apiGet<PmResolutionQueryResponse>( "/api/v1/pm/resolution/calendar", { days: days ?? 7, limit: limit ?? 25, }, ); if (!res.ok) { return { content: [ { type: "text" as const, text: `API error (${res.status}): ${JSON.stringify(res.data)}`, }, ], isError: true, }; } const { count, data } = res.data; const warn = stalenessWarning(res); const summary = `${warn}Found ${count} upcoming resolution event(s).`; const json = JSON.stringify(data, null, 2); return { content: [{ type: "text" as const, text: `${summary}\n\n${json}` }], }; }, ); - src/tools/pm_resolution.ts:99-114 (schema)Input schema for pm_resolution_calendar: optional 'days' (1-90, default 7) and 'limit' (1-100, default 25) parameters.
inputSchema: { days: z .number() .int() .min(1) .max(90) .optional() .describe("Number of days to look ahead (default 7)"), limit: z .number() .int() .min(1) .max(100) .optional() .describe("Maximum results (default 25)"), }, - src/tools/pm_resolution.ts:91-146 (registration)Registration of the tool 'pm_resolution_calendar' on the MCP server via server.registerTool(), including title, description, inputSchema, and the async handler.
server.registerTool( "pm_resolution_calendar", { title: "Polymarket Resolution Calendar", description: "Get upcoming market resolution events. Shows markets expected to resolve " + "within a given timeframe with resolution dates, sources, and current prices. " + "Cost: $0.02 per query. Source: Polymarket resolution tracking.", inputSchema: { days: z .number() .int() .min(1) .max(90) .optional() .describe("Number of days to look ahead (default 7)"), limit: z .number() .int() .min(1) .max(100) .optional() .describe("Maximum results (default 25)"), }, }, async ({ days, limit }) => { const res = await apiGet<PmResolutionQueryResponse>( "/api/v1/pm/resolution/calendar", { days: days ?? 7, limit: limit ?? 25, }, ); if (!res.ok) { return { content: [ { type: "text" as const, text: `API error (${res.status}): ${JSON.stringify(res.data)}`, }, ], isError: true, }; } const { count, data } = res.data; const warn = stalenessWarning(res); const summary = `${warn}Found ${count} upcoming resolution event(s).`; const json = JSON.stringify(data, null, 2); return { content: [{ type: "text" as const, text: `${summary}\n\n${json}` }], }; }, ); - src/index.ts:29-56 (registration)Import and invocation of registerPmResolutionTools(server) which registers all resolution tools including pm_resolution_calendar.
import { registerPmResolutionTools } from "./tools/pm_resolution.js"; import { registerEconTools } from "./tools/econ.js"; import { registerPmMicroTools } from "./tools/pm_micro.js"; function createMcpServer() { const server = new McpServer({ name: "verilex-data", version: "0.3.3", }); registerNpiTools(server); registerSecTools(server); registerPacerTools(server); registerWeatherTools(server); registerOtcTools(server); registerTrademarkTools(server); registerPatentTools(server); registerCompanyTools(server); registerCryptoTools(server); registerSanctionsTools(server); registerWhaleTools(server); registerLabelTools(server); registerHolderTools(server); registerDexTools(server); registerContractTools(server); registerPmTools(server); registerPmArbTools(server); registerPmResolutionTools(server); - src/client.ts:44-76 (helper)The 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, }; }