Skip to main content
Glama
piekstra

Slack MCP Server

by piekstra

invite_to_channel

Invite multiple users to a Slack channel using their user IDs to manage and organize workspace communication efficiently. Simplifies channel participation by automating the invitation process.

Instructions

Invite users to a Slack channel.

Args: channel: Channel ID users: Comma-separated list of user IDs

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelYes
usersYes

Implementation Reference

  • The primary MCP tool handler function for 'invite_to_channel'. It accepts channel ID and comma-separated user IDs as string, splits users, creates SlackClient instance, calls the client's invite_to_channel method, and returns JSON-formatted result or error.
    @mcp.tool() async def invite_to_channel(channel: str, users: str) -> str: """ Invite users to a Slack channel. Args: channel: Channel ID users: Comma-separated list of user IDs """ try: client = SlackClient() users_list = users.split(",") result = await client.invite_to_channel(channel, users_list) return json.dumps(result, indent=2) except Exception as e: return json.dumps({"error": str(e)}, indent=2)
  • Helper method in SlackClient class that formats the request data and calls Slack API endpoint 'conversations.invite' to invite users to the specified channel.
    async def invite_to_channel(self, channel: str, users: List[str]) -> Dict[str, Any]: """Invite users to a channel.""" data = {"channel": channel, "users": ",".join(users)} return await self._make_request("POST", "conversations.invite", 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