get_market
Retrieve comprehensive details for any prediction market by providing its ID. Access market status, probabilities, and outcomes.
Instructions
Get detailed information about a specific market
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| marketId | Yes | Market ID |
Implementation Reference
- src/index.ts:65-67 (schema)Zod schema for get_market input validation: requires a 'marketId' string.
const GetMarketSchema = z.object({ marketId: z.string(), }); - src/index.ts:228-237 (registration)Registration of the 'get_market' tool with its name, description, and input schema definition (marketId required).
name: 'get_market', description: 'Get detailed information about a specific market', inputSchema: { type: 'object', properties: { marketId: { type: 'string', description: 'Market ID' }, }, required: ['marketId'], }, }, - src/index.ts:560-582 (handler)Handler for 'get_market': parses marketId from args, calls Manifold API GET /v0/market/{marketId}, and returns the market details as JSON.
case 'get_market': { const { marketId } = GetMarketSchema.parse(args); const response = await fetch(`${API_BASE}/v0/market/${marketId}`, { headers: { Accept: 'application/json' }, }); if (!response.ok) { throw new McpError( ErrorCode.InternalError, `Manifold API error: ${response.statusText}` ); } const market = await response.json(); return { content: [ { type: 'text', text: JSON.stringify(market, null, 2), }, ], }; }