get_user
Retrieve detailed information about a specific user by providing their user ID. Ideal for integration with the Goodday project management platform to access user data securely.
Instructions
Get details of a specific user.
Args: user_id: The ID of the user to retrieve
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| user_id | Yes |
Implementation Reference
- goodday_mcp/main.py:633-648 (handler)The handler function for the 'get_user' tool. It makes an API request to retrieve user details by ID and formats the response using format_user helper. Registered via @mcp.tool() decorator.@mcp.tool() async def get_user(user_id: str) -> str: """Get details of a specific user. Args: user_id: The ID of the user to retrieve """ data = await make_goodday_request(f"user/{user_id}") if not data: return "User not found." if isinstance(data, dict) and "error" in data: return f"Unable to fetch user: {data.get('error', 'Unknown error')}" return format_user(data)
- goodday_mcp/main.py:135-149 (helper)Helper function used by get_user to format the retrieved user data into a human-readable string.def format_user(user: dict) -> str: """Format a user into a readable string with safe checks.""" if not isinstance(user, dict): return f"Invalid user data: {repr(user)}" # Defensive defaults in case nested keys are not dicts role = user.get('role') if isinstance(user.get('role'), dict) else {} return f""" User ID: {user.get('id', 'N/A')} Name: {user.get('name', 'N/A')} Email: {user.get('email', 'N/A')} Role: {role.get('name', 'N/A')} Status: {user.get('status', 'N/A')} """.strip()