cancel_bet
Cancel a specific limit order bet on the Manifold Markets MCP Server by providing the bet ID, allowing users to manage active bets efficiently.
Instructions
Cancel a limit order bet
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| betId | Yes | Bet ID to cancel |
Input Schema (JSON Schema)
{
"properties": {
"betId": {
"description": "Bet ID to cancel",
"type": "string"
}
},
"required": [
"betId"
],
"type": "object"
}
Implementation Reference
- src/index.ts:650-682 (handler)Handler for cancel_bet tool: parses betId from args, checks for MANIFOLD_API_KEY, sends POST request to Manifold API endpoint /v0/bet/cancel/{betId} to cancel the bet, returns success message.case 'cancel_bet': { const { betId } = CancelBetSchema.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/bet/cancel/${betId}`, { method: 'POST', headers: { Authorization: `Key ${apiKey}`, }, }); if (!response.ok) { throw new McpError( ErrorCode.InternalError, `Manifold API error: ${response.statusText}` ); } return { content: [ { type: 'text', text: 'Bet cancelled successfully', }, ], }; }
- src/index.ts:88-90 (schema)Zod schema defining input for cancel_bet: requires betId as string.const CancelBetSchema = z.object({ betId: z.string(), });
- src/index.ts:266-276 (registration)Registers the cancel_bet tool in the listTools response, including name, description, and inputSchema matching the Zod schema.{ name: 'cancel_bet', description: 'Cancel a limit order bet', inputSchema: { type: 'object', properties: { betId: { type: 'string', description: 'Bet ID to cancel' }, }, required: ['betId'], }, },