Skip to main content
Glama
bmorphism

Manifold Markets MCP Server

search_markets

Find prediction markets on Manifold Markets using search terms, filters by status, and sorting options to locate specific trading opportunities.

Instructions

Search for prediction markets with optional filters

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
termNoSearch query
limitNoMax number of results (1-100)
filterNo
sortNo

Implementation Reference

  • The main handler function for the 'search_markets' tool. It validates input parameters using SearchMarketsSchema, constructs a URLSearchParams query string, fetches market data from the Manifold Markets API endpoint '/v0/search-markets', handles errors, and returns the JSON-stringified results as text content.
    case 'search_markets': {
      const params = SearchMarketsSchema.parse(args);
      const searchParams = new URLSearchParams();
      if (params.term) searchParams.set('term', params.term);
      if (params.limit) searchParams.set('limit', params.limit.toString());
      if (params.filter) searchParams.set('filter', params.filter);
      if (params.sort) searchParams.set('sort', params.sort);
    
      const response = await fetch(
        `${API_BASE}/v0/search-markets?${searchParams}`,
        { headers: { Accept: 'application/json' } }
      );
    
      if (!response.ok) {
        throw new McpError(
          ErrorCode.InternalError,
          `Manifold API error: ${response.statusText}`
        );
      }
    
      const markets = await response.json();
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(markets, null, 2),
          },
        ],
      };
    }
  • Zod schema defining the input parameters for the 'search_markets' tool: optional search term, limit (1-100), filter (all/open/closed/resolved), and sort (newest/score/liquidity). Used for validation in the handler.
    const SearchMarketsSchema = z.object({
      term: z.string().optional(),
      limit: z.number().min(1).max(100).optional(),
      filter: z.enum(['all', 'open', 'closed', 'resolved']).optional(),
      sort: z.enum(['newest', 'score', 'liquidity']).optional(),
    });
  • src/index.ts:214-226 (registration)
    Tool registration entry in the listTools response. Defines the tool name, description, and JSON Schema for inputs, making it discoverable by MCP clients.
    {
      name: 'search_markets',
      description: 'Search for prediction markets with optional filters',
      inputSchema: {
        type: 'object',
        properties: {
          term: { type: 'string', description: 'Search query' },
          limit: { type: 'number', description: 'Max number of results (1-100)' },
          filter: { type: 'string', enum: ['all', 'open', 'closed', 'resolved'] },
          sort: { type: 'string', enum: ['newest', 'score', 'liquidity'] },
        },
      },
    },
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states the tool searches with filters but doesn't disclose behavioral traits such as pagination, rate limits, authentication needs, or what happens with no results. This is inadequate for a search tool with potential complexity.

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?

The description is a single, efficient sentence that front-loads the core action. It avoids unnecessary words, but could be slightly more informative without losing conciseness, such as hinting at result types or usage context.

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?

Given no annotations, no output schema, and incomplete parameter documentation (50% coverage), the description is insufficient. It doesn't explain return values, error handling, or behavioral details, making it inadequate for a search tool with four parameters and multiple sibling tools.

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 50%, with two parameters ('term', 'limit') having descriptions and two ('filter', 'sort') lacking them. The description adds minimal value by mentioning 'optional filters' but doesn't explain parameter meanings beyond what the schema provides, such as how filters or sorting affect results.

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 ('search') and resource ('prediction markets'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'get_market' or 'create_market', which would require more specificity about search functionality versus direct retrieval or creation.

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 mentions 'optional filters' but provides no explicit guidance on when to use this tool versus alternatives like 'get_market' for direct retrieval or 'create_market' for creation. There's no mention of prerequisites, exclusions, or comparative contexts, leaving usage unclear.

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