Skip to main content
Glama
bmorphism

Manifold Markets MCP Server

create_market

Create prediction markets on Manifold to forecast outcomes, gather opinions, or set bounties by defining questions, types, and parameters for binary, multiple choice, or numeric predictions.

Instructions

Create a new prediction market

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
outcomeTypeYesType of market to create
questionYesThe headline question for the market
descriptionNoOptional description for the market
closeTimeNoOptional. ISO timestamp when market will close. Defaults to 7 days.
visibilityNoOptional. Market visibility. Defaults to public.
initialProbNoRequired for BINARY markets. Initial probability (1-99)
minNoRequired for PSEUDO_NUMERIC markets. Minimum resolvable value
maxNoRequired for PSEUDO_NUMERIC markets. Maximum resolvable value
isLogScaleNoOptional for PSEUDO_NUMERIC markets. If true, increases exponentially
initialValueNoRequired for PSEUDO_NUMERIC markets. Initial value between min and max
answersNoRequired for MULTIPLE_CHOICE/POLL markets. Array of possible answers
addAnswersModeNoOptional for MULTIPLE_CHOICE markets. Controls who can add answers
shouldAnswersSumToOneNoOptional for MULTIPLE_CHOICE markets. Makes probabilities sum to 100%
totalBountyNoRequired for BOUNTIED_QUESTION markets. Amount of mana for bounty

Implementation Reference

  • The handler function for the 'create_market' tool. It parses input arguments using CreateMarketSchema, validates required fields based on outcomeType, converts description to TipTap format if necessary, makes a POST request to Manifold Markets API to create the market, and returns the URL of the created market.
    case 'create_market': {
      const params = CreateMarketSchema.parse(args);
      const apiKey = process.env.MANIFOLD_API_KEY;
      if (!apiKey) {
        throw new McpError(
          ErrorCode.InternalError,
          'MANIFOLD_API_KEY environment variable is required'
        );
      }
    
      // Validate required fields based on market type
      switch (params.outcomeType) {
        case 'BINARY':
          if (!params.initialProb) {
            throw new McpError(
              ErrorCode.InvalidParams,
              'initialProb is required for BINARY markets'
            );
          }
          break;
        case 'PSEUDO_NUMERIC':
          if (!params.min || !params.max || !params.initialValue) {
            throw new McpError(
              ErrorCode.InvalidParams,
              'min, max, and initialValue are required for PSEUDO_NUMERIC markets'
            );
          }
          break;
        case 'MULTIPLE_CHOICE':
        case 'POLL':
          if (!params.answers || !Array.isArray(params.answers)) {
            throw new McpError(
              ErrorCode.InvalidParams,
              'answers array is required for MULTIPLE_CHOICE/POLL markets'
            );
          }
          break;
        case 'BOUNTIED_QUESTION':
          if (!params.totalBounty) {
            throw new McpError(
              ErrorCode.InvalidParams,
              'totalBounty is required for BOUNTIED_QUESTION markets'
            );
          }
          break;
      }
    
      // Convert string description to TipTap format if needed
      if (typeof params.description === 'string') {
        params.description = {
          type: 'doc',
          content: [
            {
              type: 'paragraph',
              content: [
                {
                  type: 'text',
                  text: params.description
                }
              ]
            }
          ]
        };
      }
    
      const response = await fetch(`${API_BASE}/v0/market`, {
        method: 'POST',
        headers: {
          'Content-Type': 'application/json',
          Authorization: `Key ${apiKey}`,
        },
        body: JSON.stringify(params),
      });
    
      if (!response.ok) {
        const error = await response.text();
        throw new McpError(
          ErrorCode.InternalError,
          `Manifold API error: ${error}`
        );
      }
    
      const market = await response.json();
      return {
        content: [{
          type: 'text',
          text: `Created market: ${market.url}`,
        }],
      };
    }
  • Zod schema used for input validation in the create_market handler.
    const CreateMarketSchema = z.object({
      outcomeType: z.enum(['BINARY', 'MULTIPLE_CHOICE', 'PSEUDO_NUMERIC', 'POLL', 'BOUNTIED_QUESTION']),
      question: z.string(),
      description: z.union([
        z.string(),
        z.object({
          type: z.literal('doc'),
          content: z.array(z.any()),
        })
      ]).optional(),
      closeTime: z.number().optional(), // Unix timestamp in milliseconds
      visibility: z.enum(['public', 'unlisted']).optional(),
      initialProb: z.number().min(1).max(99).optional(),
      min: z.number().optional(),
      max: z.number().optional(),
      isLogScale: z.boolean().optional(),
      initialValue: z.number().optional(),
      answers: z.array(z.string()).optional(),
      addAnswersMode: z.enum(['DISABLED', 'ONLY_CREATOR', 'ANYONE']).optional(),
      shouldAnswersSumToOne: z.boolean().optional(),
      totalBounty: z.number().optional(),
      groupIds: z.array(z.string()).optional(),
    });
  • src/index.ts:144-213 (registration)
    Registration of the 'create_market' tool in the ListTools response, including name, description, and JSON input schema.
    {
      name: 'create_market',
      description: 'Create a new prediction market',
      inputSchema: {
        type: 'object',
        properties: {
          outcomeType: {
            type: 'string',
            enum: ['BINARY', 'MULTIPLE_CHOICE', 'PSEUDO_NUMERIC', 'POLL', 'BOUNTIED_QUESTION'],
            description: 'Type of market to create'
          },
          question: {
            type: 'string',
            description: 'The headline question for the market'
          },
          description: {
            type: 'string',
            description: 'Optional description for the market'
          },
          closeTime: {
            type: 'string',
            description: 'Optional. ISO timestamp when market will close. Defaults to 7 days.'
          },
          visibility: {
            type: 'string',
            enum: ['public', 'unlisted'],
            description: 'Optional. Market visibility. Defaults to public.'
          },
          initialProb: {
            type: 'number',
            description: 'Required for BINARY markets. Initial probability (1-99)'
          },
          min: {
            type: 'number',
            description: 'Required for PSEUDO_NUMERIC markets. Minimum resolvable value'
          },
          max: {
            type: 'number',
            description: 'Required for PSEUDO_NUMERIC markets. Maximum resolvable value'
          },
          isLogScale: {
            type: 'boolean',
            description: 'Optional for PSEUDO_NUMERIC markets. If true, increases exponentially'
          },
          initialValue: {
            type: 'number',
            description: 'Required for PSEUDO_NUMERIC markets. Initial value between min and max'
          },
          answers: {
            type: 'array',
            items: { type: 'string' },
            description: 'Required for MULTIPLE_CHOICE/POLL markets. Array of possible answers'
          },
          addAnswersMode: {
            type: 'string',
            enum: ['DISABLED', 'ONLY_CREATOR', 'ANYONE'],
            description: 'Optional for MULTIPLE_CHOICE markets. Controls who can add answers'
          },
          shouldAnswersSumToOne: {
            type: 'boolean',
            description: 'Optional for MULTIPLE_CHOICE markets. Makes probabilities sum to 100%'
          },
          totalBounty: {
            type: 'number',
            description: 'Required for BOUNTIED_QUESTION markets. Amount of mana for bounty'
          }
        },
        required: ['outcomeType', 'question']
      }
    },
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. 'Create a new prediction market' implies a write operation but provides no information about permissions required, rate limits, whether creation is reversible, what happens on success/failure, or any side effects. This is inadequate for a mutation tool with zero annotation coverage.

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 a single, efficient sentence that states the core purpose without any wasted words. It's appropriately sized and front-loaded with the essential information, making it easy to parse quickly.

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 complex mutation tool with 14 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what happens after creation, what permissions are needed, whether there are costs or limits, or what the tool returns. The comprehensive schema helps, but the description should provide more contextual guidance for such a significant 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 100%, so the schema already documents all 14 parameters thoroughly with descriptions and enum values. The description adds no additional parameter information beyond what's in the schema, which is acceptable given the comprehensive schema documentation but doesn't provide extra value.

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 verb ('Create') and resource ('new prediction market'), making the purpose immediately understandable. However, it doesn't differentiate this tool from sibling tools like 'close_market' or 'unresolve_market' in terms of when to use each, which prevents a perfect score.

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 'close_market' and 'unresolve_market' that operate on existing markets, there's no indication of prerequisites, timing considerations, or when this creation tool is appropriate versus other market-related operations.

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