get_user_info
Retrieve user details by providing a user ID. Designed for managing user information within the MCP Boilerplate Server environment.
Instructions
Get user information by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| user_id | Yes |
Implementation Reference
- mcp_server_boilerplate/server.py:22-31 (handler)The handler function for the 'get_user_info' tool, decorated with @mcp.tool for registration. It takes a user_id and returns mock user information or an error message if the user is not found.@mcp.tool def get_user_info(user_id: int) -> dict: """Get user information by ID""" mock_users = { 1: {"name": "Alice", "email": "alice@example.com", "role": "admin"}, 2: {"name": "Bob", "email": "bob@example.com", "role": "user"}, 3: {"name": "Charlie", "email": "charlie@example.com", "role": "user"} } return mock_users.get(user_id, {"error": "User not found"})