add_bounty
Add a bounty to a Manifold Markets prediction market to incentivize participation and increase liquidity.
Instructions
Add bounty to a market
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| contractId | Yes | Market ID | |
| amount | Yes | Amount of mana to add as bounty |
Implementation Reference
- src/index.ts:939-975 (handler)Handler function for 'add_bounty' tool: validates params with AddBountySchema, checks for MANIFOLD_API_KEY, sends POST request to Manifold API to add bounty to the specified market, returns success message.case 'add_bounty': { const params = AddBountySchema.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/market/${params.contractId}/add-bounty`, { method: 'POST', headers: { 'Content-Type': 'application/json', Authorization: `Key ${apiKey}`, }, body: JSON.stringify({ amount: params.amount, }), }); if (!response.ok) { throw new McpError( ErrorCode.InternalError, `Manifold API error: ${response.statusText}` ); } return { content: [ { type: 'text', text: 'Bounty added successfully', }, ], }; }
- src/index.ts:112-115 (schema)Zod schema for add_bounty tool input: requires contractId (string) and amount (positive finite number).const AddBountySchema = z.object({ contractId: z.string(), amount: z.number().positive().finite(), });
- src/index.ts:361-372 (registration)Tool registration in listTools handler: defines name 'add_bounty', description, and inputSchema matching the Zod schema.{ name: 'add_bounty', description: 'Add bounty to a market', inputSchema: { type: 'object', properties: { contractId: { type: 'string', description: 'Market ID' }, amount: { type: 'number', description: 'Amount of mana to add as bounty' } }, required: ['contractId', 'amount'] } },