Polymarket Arbitrage Changes
pm_arb_changesFetch recent updates to arbitrage opportunities on Polymarket since a given timestamp. Query cost: $0.005 per request.
Instructions
Get recent changes to Polymarket arbitrage data since a given timestamp. Cost: $0.005 per query. Source: Polymarket spread analysis.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| since | Yes | ISO 8601 timestamp to get changes since (e.g. 2026-03-01T00:00:00Z) | |
| limit | No | Maximum results (default 50) |
Implementation Reference
- src/tools/pm_arb.ts:110-137 (handler)The handler function that executes the pm_arb_changes tool logic. It calls the API endpoint /api/v1/pm/arb/changes with a 'since' ISO 8601 timestamp and optional 'limit', formats the response, and returns the results as text content.
async ({ since, limit }) => { const res = await apiGet<PmArbQueryResponse>("/api/v1/pm/arb/changes", { since, limit: limit ?? 50, }); 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} arbitrage change(s) since ${since}.`; const json = JSON.stringify(data, null, 2); return { content: [{ type: "text" as const, text: `${summary}\n\n${json}` }], }; }, ); - src/tools/pm_arb.ts:97-108 (schema)The input schema for pm_arb_changes, defined using Zod. Accepts 'since' (required ISO 8601 timestamp) and 'limit' (optional integer 1-100, default 50).
inputSchema: { since: z .string() .describe("ISO 8601 timestamp to get changes since (e.g. 2026-03-01T00:00:00Z)"), limit: z .number() .int() .min(1) .max(100) .optional() .describe("Maximum results (default 50)"), }, - src/tools/pm_arb.ts:90-137 (registration)Registration of the tool via server.registerTool('pm_arb_changes', ...) within the registerPmArbTools function.
server.registerTool( "pm_arb_changes", { title: "Polymarket Arbitrage Changes", description: "Get recent changes to Polymarket arbitrage data since a given timestamp. " + "Cost: $0.005 per query. Source: Polymarket spread analysis.", inputSchema: { since: z .string() .describe("ISO 8601 timestamp to get changes since (e.g. 2026-03-01T00:00:00Z)"), limit: z .number() .int() .min(1) .max(100) .optional() .describe("Maximum results (default 50)"), }, }, async ({ since, limit }) => { const res = await apiGet<PmArbQueryResponse>("/api/v1/pm/arb/changes", { since, limit: limit ?? 50, }); 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} arbitrage change(s) since ${since}.`; const json = JSON.stringify(data, null, 2); return { content: [{ type: "text" as const, text: `${summary}\n\n${json}` }], }; }, ); - src/index.ts:28-28 (registration)Import of registerPmArbTools from the pm_arb module.
import { registerPmArbTools } from "./tools/pm_arb.js"; - src/index.ts:55-55 (registration)Invocation of registerPmArbTools(server) to wire the tool into the MCP server.
registerPmArbTools(server);