Skip to main content
Glama
piekstra

Slack MCP Server

by piekstra

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
NameRequiredDescriptionDefault
channelYes
topicYes

Implementation Reference

  • 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)
  • 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)

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