get_user
Get user details by username. Integrates with Manifold Markets to fetch profile data through natural language commands.
Instructions
Get user information by username
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| username | Yes | Username |
Implementation Reference
- src/index.ts:69-71 (schema)Zod schema for get_user input validation: expects a 'username' string.
const GetUserSchema = z.object({ username: z.string(), }); - src/index.ts:238-248 (registration)Tool registration for 'get_user' with name, description, and inputSchema.
{ name: 'get_user', description: 'Get user information by username', inputSchema: { type: 'object', properties: { username: { type: 'string', description: 'Username' }, }, required: ['username'], }, }, - src/index.ts:584-606 (handler)Handler logic for 'get_user': parses args, fetches user from Manifold API, returns JSON.
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), }, ], }; }