get_market_resolution
Check the UMA oracle resolution status of Polymarket markets. See if a market is initialized, proposed, disputed, or resolved, along with prices and dispute history.
Instructions
Get the UMA oracle resolution status for Polymarket markets. Shows whether a market is initialized, proposed, disputed, or resolved, plus proposed/final prices and dispute history.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| first | No | Number of markets to return (1-100) | |
| status | No | Optional: filter by resolution status | |
| orderBy | No | Field to sort by | lastUpdateTimestamp |
| orderDirection | No | Sort direction | desc |
Implementation Reference
- src/index.ts:722-767 (registration)Registration of the 'get_market_resolution' tool using server.registerTool. Defines its description and inputSchema (first, status, orderBy, orderDirection). The handler queries the 'resolution' subgraph (SUBGRAPHS.resolution.ipfsHash) for MarketResolution entities with filtering/sorting.
// --------------------------------------------------------------------------- // Tool 16: get_market_resolution // --------------------------------------------------------------------------- server.registerTool( "get_market_resolution", { description: "Get the UMA oracle resolution status for Polymarket markets. Shows whether a market is initialized, proposed, disputed, or resolved, plus proposed/final prices and dispute history.", inputSchema: { first: z.number().min(1).max(100).default(10).describe("Number of markets to return (1-100)"), status: z .enum(["initialized", "proposed", "resolved", "disputed", "challenged", "reproposed"]) .optional() .describe("Optional: filter by resolution status"), orderBy: z .enum(["lastUpdateTimestamp", "id"]) .default("lastUpdateTimestamp") .describe("Field to sort by"), orderDirection: z.enum(["asc", "desc"]).default("desc").describe("Sort direction"), }, }, async ({ first, status, orderBy, orderDirection }) => { try { const where = status ? `, where: { status: "${status}" }` : ""; const query = `{ marketResolutions(first: ${first}, orderBy: ${orderBy}, orderDirection: ${orderDirection}${where}) { id status flagged paused wasDisputed proposedPrice reproposedPrice price lastUpdateTimestamp requestTransactionHash resolutionTransactionHash } }`; const data = await querySubgraph(SUBGRAPHS.resolution.ipfsHash, query); return textResult(data); } catch (error) { return errorResult(error); } } ); - src/index.ts:743-767 (handler)The handler function for get_market_resolution. It executes a GraphQL query against the resolution subgraph, fetching MarketResolution fields (id, status, flagged, paused, wasDisputed, proposedPrice, reproposedPrice, price, lastUpdateTimestamp, requestTransactionHash, resolutionTransactionHash). Supports optional status filter, ordering, and direction.
async ({ first, status, orderBy, orderDirection }) => { try { const where = status ? `, where: { status: "${status}" }` : ""; const query = `{ marketResolutions(first: ${first}, orderBy: ${orderBy}, orderDirection: ${orderDirection}${where}) { id status flagged paused wasDisputed proposedPrice reproposedPrice price lastUpdateTimestamp requestTransactionHash resolutionTransactionHash } }`; const data = await querySubgraph(SUBGRAPHS.resolution.ipfsHash, query); return textResult(data); } catch (error) { return errorResult(error); } } ); - src/index.ts:725-741 (schema)Input schema for get_market_resolution. Defines parameters: 'first' (1-100, default 10), optional 'status' enum (initialized/proposed/resolved/disputed/challenged/reproposed), 'orderBy' (lastUpdateTimestamp or id), and 'orderDirection' (asc/desc).
server.registerTool( "get_market_resolution", { description: "Get the UMA oracle resolution status for Polymarket markets. Shows whether a market is initialized, proposed, disputed, or resolved, plus proposed/final prices and dispute history.", inputSchema: { first: z.number().min(1).max(100).default(10).describe("Number of markets to return (1-100)"), status: z .enum(["initialized", "proposed", "resolved", "disputed", "challenged", "reproposed"]) .optional() .describe("Optional: filter by resolution status"), orderBy: z .enum(["lastUpdateTimestamp", "id"]) .default("lastUpdateTimestamp") .describe("Field to sort by"), orderDirection: z.enum(["asc", "desc"]).default("desc").describe("Sort direction"), },