get_user_info
Retrieve detailed information about a specific Slack user, including user ID, by leveraging the Slack MCP Server for seamless user management and data access.
Instructions
Get detailed information about a specific Slack user.
Args: user_id: The ID of the user
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| user_id | Yes |
Implementation Reference
- slack_mcp/server.py:274-288 (handler)The primary handler function for the 'get_user_info' MCP tool. It is registered via the @mcp.tool() decorator and implements the tool logic by instantiating SlackClient and calling its get_user_info method to retrieve user information from the Slack API, returning the result as formatted JSON.@mcp.tool() async def get_user_info(user_id: str) -> str: """ Get detailed information about a specific Slack user. Args: user_id: The ID of the user """ try: client = SlackClient() result = await client.get_user_info(user_id) return json.dumps(result, indent=2) except Exception as e: return json.dumps({"error": str(e)}, indent=2)
- slack_mcp/server.py:97-100 (helper)Supporting helper method in the SlackClient class that performs the actual Slack API call to the 'users.info' endpoint to fetch detailed user information.async def get_user_info(self, user_id: str) -> Dict[str, Any]: """Get detailed information about a specific user.""" params = {"user": user_id} return await self._make_request("GET", "users.info", params=params)