Skip to main content
Glama
piekstra

Slack MCP Server

by piekstra

set_channel_topic

Update a Slack channel's topic by specifying the channel ID and new topic text to organize discussions and provide context for team members.

Instructions

Set the topic for a Slack channel.

Args: channel: Channel ID topic: New topic text

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelYes
topicYes

Implementation Reference

  • MCP tool handler function for set_channel_topic. Registers the tool via @mcp.tool() decorator and implements the logic by calling SlackClient.set_channel_topic.
    @mcp.tool()
    async def set_channel_topic(channel: str, topic: str) -> str:
        """
        Set the topic for a Slack channel.
    
        Args:
            channel: Channel ID
            topic: New topic text
        """
        try:
            client = SlackClient()
            result = await client.set_channel_topic(channel, topic)
            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 set the channel topic using conversations.setTopic endpoint.
    async def set_channel_topic(self, channel: str, topic: str) -> Dict[str, Any]:
        """Set the topic for a channel."""
        data = {"channel": channel, "topic": topic}
        return await self._make_request("POST", "conversations.setTopic", json_data=data)

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