get_user
Retrieve user details by ID from the MCP Test Server's user management system. Provide the user ID to access specific user information.
Instructions
Get a specific user by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | User ID |
Implementation Reference
- src/domains/users.js:18-32 (handler)The core handler function that retrieves a specific user by ID from the mock users data and returns success or error response.static getById(id) { const user = users.find(u => u.id === id); if (!user) { return { success: false, message: 'User not found' }; } return { success: true, data: user }; }
- src/domains/users.js:86-99 (schema)Input schema definition for the 'get_user' tool, specifying a required numeric 'id' parameter.{ name: 'get_user', description: 'Get a specific user by ID', inputSchema: { type: 'object', properties: { id: { type: 'number', description: 'User ID' } }, required: ['id'] } },
- mcp-server.js:56-57 (registration)Tool call dispatcher that maps 'get_user' requests to the UserService.getById handler.case 'get_user': return createMcpResponse(UserService.getById(args.id));
- mcp-server.js:38-46 (registration)Registers the list tools handler which includes the 'get_user' schema from userToolSchemas.this.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [ ...userToolSchemas, ...taskToolSchemas, searchToolSchema ] }; });