set_channel_topic
Update and manage the topic of a Slack channel by specifying the channel ID and the new topic text for clear and organized communication within your workspace.
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)The MCP tool handler for 'set_channel_topic', decorated with @mcp.tool() for registration, which instantiates SlackClient and delegates to its set_channel_topic method, returning the JSON-formatted API response or error.@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)Helper method in SlackClient class that makes the authenticated POST request to Slack's 'conversations.setTopic' API endpoint to set the channel topic.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)