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
| Name | Required | Description | Default |
|---|---|---|---|
| channel | Yes | ||
| users | Yes |
Implementation Reference
- slack_mcp/server.py:506-522 (handler)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)
- slack_mcp/server.py:206-210 (helper)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)