Skip to main content
Glama
piekstra

Slack MCP Server

by piekstra

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

Implementation Reference

  • 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)
  • 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)

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