Skip to main content
Glama
bmorphism

Manifold Markets MCP Server

create_market

Create a new prediction market with customizable outcomes, close time, and visibility. Supports binary, multiple choice, numeric, poll, and bounty types.

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

  • Zod schema defining the input validation for create_market tool. Validates fields like outcomeType, question, description, closeTime, visibility, initialProb, min, max, isLogScale, initialValue, answers, addAnswersMode, shouldAnswersSumToOne, totalBounty, and groupIds.
    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 handler, including its name, description, and JSON Schema inputSchema.
    {
      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']
      }
    },
  • Handler logic for 'create_market' that parses arguments via Zod schema, validates required fields per outcomeType, converts string descriptions to TipTap format, POSTs to the Manifold API (v0/market), and returns the created market URL.
    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}`,
        }],
      };
    }
Behavior2/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It only states 'Create a new prediction market' without revealing any side effects, permissions, or post-creation state. Critical behavioral context is missing.

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

Conciseness2/5

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

The description is extremely short (6 words), but it lacks substance. It does not front-load key details or earn its place beyond restating the tool name. Under-specification, not conciseness.

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 tool with 14 parameters (many conditionally required) and no output schema, the description is woefully incomplete. It does not explain return values, validation, or conditional logic.

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 parameters. The description adds no additional meaning beyond what the schema provides. Baseline 3 is appropriate.

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 'Create a new prediction market' with a specific verb and resource. However, it does not distinguish this tool from sibling tools that also operate on markets (e.g., close_market, add_liquidity).

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 is provided on when to use this tool versus alternatives. The description does not mention any prerequisites, when-not-to-use, or comparisons with sibling tools.

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