Skip to main content
Glama
piekstra

Slack MCP Server

by piekstra

archive_channel

Archive a Slack channel by providing its channel ID to remove it from active workspace view while preserving its history.

Instructions

Archive a Slack channel.

Args: channel: Channel ID to archive

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelYes

Implementation Reference

  • MCP tool handler function for archiving a Slack channel. Creates a SlackClient instance, calls its archive_channel method, and returns the JSON-formatted result or error.
    @mcp.tool()
    async def archive_channel(channel: str) -> str:
        """
        Archive a Slack channel.
    
        Args:
            channel: Channel ID to archive
        """
        try:
            client = SlackClient()
            result = await client.archive_channel(channel)
            return json.dumps(result, indent=2)
        except Exception as e:
            return json.dumps({"error": str(e)}, indent=2)
  • SlackClient helper method that performs the actual Slack API call to archive the specified channel using the conversations.archive endpoint.
    async def archive_channel(self, channel: str) -> Dict[str, Any]:
        """Archive a channel."""
        data = {"channel": channel}
        return await self._make_request("POST", "conversations.archive", json_data=data)
  • FastMCP tool registration decorator that registers the archive_channel function as an MCP tool.
    @mcp.tool()

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