Skip to main content
Glama

Manifold Markets MCP Server

search_markets

Search for prediction markets using customizable filters like status (open, closed, resolved) and sorting options (newest, score, liquidity). Retrieve relevant market data with a specified limit for efficient browsing.

Instructions

Search for prediction markets with optional filters

Input Schema

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

Input Schema (JSON Schema)

{ "properties": { "filter": { "enum": [ "all", "open", "closed", "resolved" ], "type": "string" }, "limit": { "description": "Max number of results (1-100)", "type": "number" }, "sort": { "enum": [ "newest", "score", "liquidity" ], "type": "string" }, "term": { "description": "Search query", "type": "string" } }, "type": "object" }

Implementation Reference

  • Handler for the search_markets tool: parses input parameters using SearchMarketsSchema, constructs query parameters for the Manifold Markets API search endpoint, fetches the results, and returns them as a formatted JSON string.
    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 term for search query, limit (1-100), filter by status, and sort options.
    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)
    Registration of the search_markets tool in the list of available tools, including name, description, and JSON schema for inputs.
    { 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'] }, }, }, },

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