Skip to main content
Glama

Manifold Markets MCP Server

get_positions

Retrieve a user’s positions across all markets on Manifold Markets. Input a user ID to access detailed market participation and investment data.

Instructions

Get user positions across markets

Input Schema

NameRequiredDescriptionDefault
userIdYesUser ID

Input Schema (JSON Schema)

{ "properties": { "userId": { "description": "User ID", "type": "string" } }, "required": [ "userId" ], "type": "object" }

Implementation Reference

  • Handler for the 'get_positions' tool. Parses userId from arguments, fetches user's bets/positions from Manifold API /v0/bets endpoint, handles errors, and returns JSON stringified positions.
    case 'get_positions': { const { userId } = GetUserPositionsSchema.parse(args); const response = await fetch( `${API_BASE}/v0/bets?userId=${userId}`, { headers: { Accept: 'application/json' } } ); if (!response.ok) { throw new McpError( ErrorCode.InternalError, `Manifold API error: ${response.statusText}` ); } const positions = await response.json(); return { content: [ { type: 'text', text: JSON.stringify(positions, null, 2), }, ], }; }
  • Zod input validation schema for 'get_positions' tool requiring a 'userId' string.
    const GetUserPositionsSchema = z.object({ userId: z.string(), });
  • src/index.ts:302-312 (registration)
    Tool registration in listTools handler, defining name, description, and input schema for 'get_positions'.
    { name: 'get_positions', description: 'Get user positions across markets', inputSchema: { type: 'object', properties: { userId: { type: 'string', description: 'User ID' }, }, required: ['userId'], }, },

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