get_user
Retrieve user details by username on Manifold Markets, enabling easy access to profile information within the prediction platform for streamlined interactions.
Instructions
Get user information by username
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| username | Yes | Username |
Implementation Reference
- src/index.ts:584-606 (handler)Handler for 'get_user' tool: fetches user data from Manifold Markets API by username using GetUserSchema for validation and returns JSON stringified user info.case 'get_user': { const { username } = GetUserSchema.parse(args); const response = await fetch(`${API_BASE}/v0/user/${username}`, { headers: { Accept: 'application/json' }, }); if (!response.ok) { throw new McpError( ErrorCode.InternalError, `Manifold API error: ${response.statusText}` ); } const user = await response.json(); return { content: [ { type: 'text', text: JSON.stringify(user, null, 2), }, ], }; }
- src/index.ts:69-71 (schema)Zod schema for validating input parameters of the 'get_user' tool, requiring a 'username' string.const GetUserSchema = z.object({ username: z.string(), });
- src/index.ts:238-248 (registration)Registration of the 'get_user' tool in the MCP server's tool list, including name, description, and input schema.{ name: 'get_user', description: 'Get user information by username', inputSchema: { type: 'object', properties: { username: { type: 'string', description: 'Username' }, }, required: ['username'], }, },