Skip to main content
Glama
piekstra

Slack MCP Server

by piekstra

list_users

Retrieve all users in a Slack workspace with optional parameters to limit results and include locale information for each user.

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
NameRequiredDescriptionDefault
limitNo
include_localeNo

Implementation Reference

  • The main MCP tool handler for 'list_users'. Decorated with @mcp.tool() for registration. Creates SlackClient, calls its list_users method, and returns JSON-formatted result.
    @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)
  • Helper method in SlackClient class that makes the API call to Slack's 'users.list' 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)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/piekstra/slack-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server