Skip to main content
Glama
piekstra

Slack MCP Server

by piekstra

list_channels

Retrieve available Slack channels by type, filter out archived ones, and set result limits for workspace navigation.

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
typesNo
exclude_archivedNo
limitNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main MCP tool handler for 'list_channels'. Decorated with @mcp.tool() for registration. Handles input parameters, instantiates SlackClient, calls its list_channels method, and returns JSON-formatted result or error.
    @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)
  • Helper method in SlackClient class that constructs parameters and makes the Slack API request to 'conversations.list' endpoint.
    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)
  • The @mcp.tool() decorator registers the list_channels function as an MCP tool.
    @mcp.tool()
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions the action ('List all channels') but doesn't cover critical aspects like authentication requirements, rate limits, pagination behavior, error conditions, or what the output contains. This leaves significant gaps for a tool with three parameters.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is perfectly structured and concise. The first sentence states the core purpose, followed by a clean parameter breakdown with brief but informative explanations. Every sentence earns its place with no wasted words or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has an output schema (which handles return values), 3 parameters with good description coverage, and no complex annotations, the description is adequate but incomplete. It lacks behavioral context (auth, rate limits, errors) that would be important for a listing tool, though the output schema reduces some burden.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description provides clear semantic explanations for all three parameters beyond the schema's 0% coverage. It explains what 'types' accepts, what 'exclude_archived' does, and the range/meaning of 'limit'. This effectively compensates for the schema's lack of descriptions, though it doesn't cover default values or null handling.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('List') and resource ('all channels in the Slack workspace'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_channel_info' or 'get_channel_history' that also retrieve channel-related data, which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'list_users' for user listings or 'get_channel_info' for detailed single-channel information, leaving the agent without context for tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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