list_users
Retrieve a list of all users in a Slack workspace, with options to limit results and include locale details for effective user management.
Instructions
List all users in the Slack workspace.
Args: limit: Maximum number of users to return include_locale: Include locale information for each user
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| include_locale | No | ||
| limit | No |
Implementation Reference
- slack_mcp/server.py:257-272 (handler)The primary handler function for the 'list_users' MCP tool. Decorated with @mcp.tool() which registers it. It instantiates SlackClient, calls its list_users method, and returns the JSON-formatted result or error.@mcp.tool() async def list_users(limit: int = 100, include_locale: bool = False) -> str: """ List all users in the Slack workspace. Args: limit: Maximum number of users to return include_locale: Include locale information for each user """ try: client = SlackClient() result = await client.list_users(limit, include_locale) return json.dumps(result, indent=2) except Exception as e: return json.dumps({"error": str(e)}, indent=2)
- slack_mcp/server.py:92-95 (helper)The SlackClient class method that implements the core logic by making an authenticated GET request to Slack's 'users.list' API endpoint.async def list_users(self, limit: int = 100, include_locale: bool = False) -> Dict[str, Any]: """List all users in the workspace.""" params = {"limit": limit, "include_locale": include_locale} return await self._make_request("GET", "users.list", params=params)