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
| Name | Required | Description | Default |
|---|---|---|---|
| contractId | Yes | Market ID | |
| follow | Yes | True 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
- src/index.ts:900-937 (handler)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', }, ], }; }
- src/index.ts:107-110 (schema)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'] } },