Skip to main content
Glama

Manifold Markets MCP Server

place_bet

Place bets on Manifold Markets prediction platform by specifying market ID, amount, and outcome. Optionally set a limit probability for precise trading decisions.

Instructions

Place a bet on a market

Input Schema

NameRequiredDescriptionDefault
amountYesAmount to bet in mana
limitProbNoOptional limit order probability (0.01-0.99)
marketIdYesMarket ID
outcomeYes

Input Schema (JSON Schema)

{ "properties": { "amount": { "description": "Amount to bet in mana", "type": "number" }, "limitProb": { "description": "Optional limit order probability (0.01-0.99)", "type": "number" }, "marketId": { "description": "Market ID", "type": "string" }, "outcome": { "enum": [ "YES", "NO" ], "type": "string" } }, "required": [ "marketId", "amount", "outcome" ], "type": "object" }

Implementation Reference

  • Handler function for 'place_bet' tool: parses arguments using PlaceBetSchema, checks for MANIFOLD_API_KEY, sends POST request to Manifold Markets /v0/bet API, handles errors, and returns the bet result as JSON.
    case 'place_bet': { const params = PlaceBetSchema.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`, { method: 'POST', headers: { 'Content-Type': 'application/json', Authorization: `Key ${apiKey}`, }, body: JSON.stringify({ contractId: params.marketId, amount: params.amount, outcome: params.outcome, limitProb: params.limitProb, }), }); if (!response.ok) { throw new McpError( ErrorCode.InternalError, `Manifold API error: ${response.statusText}` ); } const result = await response.json(); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
  • Zod schema defining input parameters for place_bet: marketId (string), amount (positive number), outcome (YES/NO), optional limitProb (0.01-0.99).
    const PlaceBetSchema = z.object({ marketId: z.string(), amount: z.number().positive(), outcome: z.enum(['YES', 'NO']), limitProb: z.number().min(0.01).max(0.99).optional(), });
  • src/index.ts:249-265 (registration)
    Tool registration in listTools handler: defines name, description, and inputSchema matching the Zod schema for MCP tool discovery.
    { name: 'place_bet', description: 'Place a bet on a market', inputSchema: { type: 'object', properties: { marketId: { type: 'string', description: 'Market ID' }, amount: { type: 'number', description: 'Amount to bet in mana' }, outcome: { type: 'string', enum: ['YES', 'NO'] }, limitProb: { type: 'number', description: 'Optional limit order probability (0.01-0.99)', }, }, required: ['marketId', 'amount', 'outcome'], }, },

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bmorphism/manifold-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server