get_market_revisions
Retrieve moderator revisions for Polymarket markets to see when and how moderators intervened in market resolution.
Instructions
Get moderator revisions/updates for Polymarket markets. Shows when and how moderators intervened in market resolution.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| questionId | No | Optional: filter revisions for a specific market questionId | |
| first | No | Number of revisions to return |
Implementation Reference
- src/index.ts:805-837 (registration)Registration of the 'get_market_revisions' tool using server.registerTool. The tool queries the 'resolution' subgraph for Revision entities (moderator updates to market resolution). It accepts optional questionId filter and first parameter.
// --------------------------------------------------------------------------- // Tool 18: get_market_revisions // --------------------------------------------------------------------------- server.registerTool( "get_market_revisions", { description: "Get moderator revisions/updates for Polymarket markets. Shows when and how moderators intervened in market resolution.", inputSchema: { questionId: z.string().optional().describe("Optional: filter revisions for a specific market questionId"), first: z.number().min(1).max(100).default(20).describe("Number of revisions to return"), }, }, async ({ questionId, first }) => { try { const where = questionId ? `, where: { questionId: "${questionId}" }` : ""; const query = `{ revisions(first: ${first}, orderBy: timestamp, orderDirection: desc${where}) { id moderator questionId timestamp update transactionHash } }`; const data = await querySubgraph(SUBGRAPHS.resolution.ipfsHash, query); return textResult(data); } catch (error) { return errorResult(error); } } ); - src/index.ts:818-837 (handler)Handler function that executes the tool logic. Builds a GraphQL query for 'revisions' from the resolution subgraph, optionally filtered by questionId, ordered by timestamp descending. Returns moderator, questionId, timestamp, update, and transactionHash fields.
async ({ questionId, first }) => { try { const where = questionId ? `, where: { questionId: "${questionId}" }` : ""; const query = `{ revisions(first: ${first}, orderBy: timestamp, orderDirection: desc${where}) { id moderator questionId timestamp update transactionHash } }`; const data = await querySubgraph(SUBGRAPHS.resolution.ipfsHash, query); return textResult(data); } catch (error) { return errorResult(error); } } ); - src/index.ts:812-817 (schema)Input schema for get_market_revisions. Accepts optional questionId (string) and first (number, 1-100, default 20).
"Get moderator revisions/updates for Polymarket markets. Shows when and how moderators intervened in market resolution.", inputSchema: { questionId: z.string().optional().describe("Optional: filter revisions for a specific market questionId"), first: z.number().min(1).max(100).default(20).describe("Number of revisions to return"), }, },