Skip to main content
Glama
bmorphism

Manifold Markets MCP Server

place_bet

Place a bet on a Manifold market by specifying market ID, amount, and outcome. Optionally set a limit order probability.

Instructions

Place a bet on a market

Input Schema

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

Implementation Reference

  • Handler for place_bet tool. Parses args using PlaceBetSchema, requires MANIFOLD_API_KEY, sends POST to Manifold /v0/bet API, and returns the bet result 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 for place_bet input validation: marketId (string), amount (positive number), outcome (YES/NO), and 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:250-265 (registration)
    Registration of place_bet tool in ListToolsRequestSchema handler with description and input schema.
      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'],
      },
    },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided. Description fails to disclose behavioral traits such as authentication requirements, limits, or side effects (e.g., balance deduction). The simple statement 'Place a bet' is insufficient for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Extremely concise, single sentence. While efficient, it lacks important details, but no redundant words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema and minimal description. For a betting action, return values (e.g., bet ID, status) and side effects (e.g., fund deduction) are not mentioned. Incomplete for a write operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 75%, so the schema already explains most parameters. The description adds no additional meaning beyond what's in the schema (e.g., meaning of outcome 'YES' vs 'NO', behavior of limitProb). Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action 'Place' and the resource 'a bet on a market'. It effectively distinguishes from sibling tools like cancel_bet or sell_shares.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives (e.g., cancel_bet, sell_shares). No prerequisites or constraints mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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