add_bounty
Add a bounty to a Manifold Markets prediction market by specifying the market ID and the amount of mana to contribute, enhancing incentives for accurate predictions.
Instructions
Add bounty to a market
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | Amount of mana to add as bounty | |
| contractId | Yes | Market ID |
Input Schema (JSON Schema)
{
"properties": {
"amount": {
"description": "Amount of mana to add as bounty",
"type": "number"
},
"contractId": {
"description": "Market ID",
"type": "string"
}
},
"required": [
"contractId",
"amount"
],
"type": "object"
}
Implementation Reference
- src/index.ts:939-975 (handler)Handler function for add_bounty tool: parses input with AddBountySchema, checks API key, makes 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 defining input parameters for add_bounty: 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, description, and inputSchema for the MCP tool discovery.{ 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'] } },