Skip to main content
Glama
piekstra

Slack MCP Server

by piekstra

list_channels

List all active or specific types of channels in a Slack workspace. Filter by channel type, exclude archived channels, and set a limit on the number of results returned.

Instructions

List all channels in the Slack workspace.

Args: types: Comma-separated channel types (public_channel, private_channel, mpim, im) exclude_archived: Whether to exclude archived channels limit: Maximum number of channels to return (1-1000)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
exclude_archivedNo
limitNo
typesNo

Implementation Reference

  • The MCP tool handler for 'list_channels', registered via @mcp.tool() decorator. Handles input parameters, invokes SlackClient helper, and formats response as JSON.
    @mcp.tool() async def list_channels(types: Optional[str] = None, exclude_archived: bool = True, limit: int = 100) -> str: """ List all channels in the Slack workspace. Args: types: Comma-separated channel types (public_channel, private_channel, mpim, im) exclude_archived: Whether to exclude archived channels limit: Maximum number of channels to return (1-1000) """ try: client = SlackClient() types_list = types.split(",") if types else None result = await client.list_channels(types_list, exclude_archived, limit) return json.dumps(result, indent=2) except Exception as e: return json.dumps({"error": str(e)}, indent=2)
  • SlackClient helper method that constructs parameters and calls Slack conversations.list API via _make_request.
    async def list_channels( self, types: Optional[List[str]] = None, exclude_archived: bool = True, limit: int = 100 ) -> Dict[str, Any]: """List all channels in the workspace.""" params = {"exclude_archived": exclude_archived, "limit": limit} if types: params["types"] = ",".join(types) return await self._make_request("GET", "conversations.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