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
| Name | Required | Description | Default |
|---|---|---|---|
| channel | Yes | ||
| topic | Yes |
Implementation Reference
- slack_mcp/server.py:524-539 (handler)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)
- slack_mcp/server.py:211-214 (helper)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)