Skip to main content
Glama
bmorphism

Manifold Markets MCP Server

cancel_bet

Cancel a limit order bet on Manifold Markets by specifying the bet ID to remove pending wagers from prediction markets.

Instructions

Cancel a limit order bet

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
betIdYesBet ID to cancel

Implementation Reference

  • Executes the cancel_bet tool: validates input with CancelBetSchema, authenticates with MANIFOLD_API_KEY, sends POST request to Manifold Markets API to cancel the specified 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',
          },
        ],
      };
    }
  • Zod schema defining the input for cancel_bet tool: requires a 'betId' string.
    const CancelBetSchema = z.object({
      betId: z.string(),
    });
  • src/index.ts:266-276 (registration)
    Registers the 'cancel_bet' tool in the MCP server's tool list, providing name, description, and input schema for listing available tools.
    {
      name: 'cancel_bet',
      description: 'Cancel a limit order bet',
      inputSchema: {
        type: 'object',
        properties: {
          betId: { type: 'string', description: 'Bet ID to cancel' },
        },
        required: ['betId'],
      },
    },
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. 'Cancel' implies a destructive/mutative operation, but the description doesn't specify whether this requires special permissions, whether it's reversible, what happens to associated funds, or what the response looks like. This is a significant gap 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.

Conciseness5/5

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

The description is extremely concise at just four words, with zero wasted language. It's front-loaded with the core action and target, making it immediately understandable despite its brevity.

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?

For a mutation tool with no annotations and no output schema, the description is inadequate. It doesn't explain what happens upon cancellation (e.g., funds returned, order removed from book), error conditions, or confirmation of success. Given the complexity of financial operations, this leaves significant gaps for an AI agent.

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 100%, so the schema already documents the single 'betId' parameter. The description doesn't add any additional semantic context about what constitutes a valid bet ID, format expectations, or how to obtain bet IDs. Baseline 3 is appropriate when the schema does the heavy lifting.

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

Purpose4/5

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

The description clearly states the action ('cancel') and the target ('a limit order bet'), providing a specific verb+resource combination. However, it doesn't differentiate from sibling tools like 'close_market' or 'sell_shares', which might involve similar cancellation concepts in this betting/market context.

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?

The description provides no guidance on when to use this tool versus alternatives. With sibling tools like 'place_bet', 'sell_shares', and 'close_market' available, there's no indication of when cancellation is appropriate versus other methods of exiting positions or modifying orders.

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