unresolve_market
Reopen a resolved prediction market on Manifold Markets to allow further trading or updates by specifying the market ID and optional answer ID for multiple choice markets.
Instructions
Unresolve a previously resolved market
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| answerId | No | Optional. Answer ID for multiple choice markets | |
| contractId | Yes | Market ID |
Input Schema (JSON Schema)
{
"properties": {
"answerId": {
"description": "Optional. Answer ID for multiple choice markets",
"type": "string"
},
"contractId": {
"description": "Market ID",
"type": "string"
}
},
"required": [
"contractId"
],
"type": "object"
}
Implementation Reference
- src/index.ts:787-821 (handler)The handler case for 'unresolve_market' in the main switch statement. It parses input parameters using UnresolveMarketSchema, checks for the required MANIFOLD_API_KEY environment variable, makes a POST request to Manifold's /v0/unresolve endpoint with the parameters, handles any errors from the API, and returns a success message.case 'unresolve_market': { const params = UnresolveMarketSchema.parse(args); const apiKey = process.env.MANIFOLD_API_KEY; if (!apiKey) { throw new McpError( ErrorCode.InternalError, 'MANIFOLD_API_KEY environment variable is required' ); } const response = await fetch(`${API_BASE}/v0/unresolve`, { method: 'POST', headers: { 'Content-Type': 'application/json', Authorization: `Key ${apiKey}`, }, body: JSON.stringify(params), }); if (!response.ok) { throw new McpError( ErrorCode.InternalError, `Manifold API error: ${response.statusText}` ); } return { content: [ { type: 'text', text: 'Market unresolved successfully', }, ], }; }
- src/index.ts:92-95 (schema)Zod schema definition for validating input parameters of the unresolve_market tool: requires contractId (string), optional answerId (string).const UnresolveMarketSchema = z.object({ contractId: z.string(), answerId: z.string().optional(), });
- src/index.ts:314-324 (registration)Registration of the 'unresolve_market' tool in the MCP server's tools list, including name, description, and input schema matching the Zod schema.name: 'unresolve_market', description: 'Unresolve a previously resolved market', inputSchema: { type: 'object', properties: { contractId: { type: 'string', description: 'Market ID' }, answerId: { type: 'string', description: 'Optional. Answer ID for multiple choice markets' } }, required: ['contractId'] } },