Skip to main content
Glama

Manifold Markets MCP Server

follow_market

Enable or disable notifications for specific prediction markets on Manifold Markets by following or unfollowing them using the market ID and a follow toggle.

Instructions

Follow or unfollow a market

Input Schema

NameRequiredDescriptionDefault
contractIdYesMarket ID
followYesTrue to follow, false to unfollow

Input Schema (JSON Schema)

{ "properties": { "contractId": { "description": "Market ID", "type": "string" }, "follow": { "description": "True to follow, false to unfollow", "type": "boolean" } }, "required": [ "contractId", "follow" ], "type": "object" }

Implementation Reference

  • Handler implementation for the 'follow_market' tool. Parses input using FollowMarketSchema, authenticates with MANIFOLD_API_KEY, makes POST request to Manifold's /v0/follow-contract endpoint, and returns success message.
    case 'follow_market': { const params = FollowMarketSchema.parse(args); const apiKey = process.env.MANIFOLD_API_KEY; if (!apiKey) { throw new McpError( ErrorCode.InternalError, 'MANIFOLD_API_KEY environment variable is required' ); } const response = await fetch(`${API_BASE}/v0/follow-contract`, { method: 'POST', headers: { 'Content-Type': 'application/json', Authorization: `Key ${apiKey}`, }, body: JSON.stringify({ contractId: params.contractId, follow: params.follow, }), }); if (!response.ok) { throw new McpError( ErrorCode.InternalError, `Manifold API error: ${response.statusText}` ); } return { content: [ { type: 'text', text: params.follow ? 'Now following market' : 'Unfollowed market', }, ], }; }
  • Zod schema defining the input parameters for the follow_market tool: contractId (string) and follow (boolean).
    const FollowMarketSchema = z.object({ contractId: z.string(), follow: z.boolean(), });
  • src/index.ts:349-360 (registration)
    Tool registration entry in the ListTools response, specifying name, description, and JSON schema for inputs.
    { name: 'follow_market', description: 'Follow or unfollow a market', inputSchema: { type: 'object', properties: { contractId: { type: 'string', description: 'Market ID' }, follow: { type: 'boolean', description: 'True to follow, false to unfollow' } }, required: ['contractId', 'follow'] } },

Other Tools

Related 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