add_reaction
Add an emoji reaction to a specific message in a Slack channel using channel ID, message timestamp, and emoji name. Facilitates quick and precise engagement in Slack workspaces.
Instructions
Add a reaction emoji to a message.
Args: channel: Channel ID where the message exists timestamp: Timestamp of the message emoji_name: Name of the emoji (without colons)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| channel | Yes | ||
| emoji_name | Yes | ||
| timestamp | Yes |
Implementation Reference
- slack_mcp/server.py:410-425 (handler)The primary handler function for the 'add_reaction' MCP tool. It is registered via the @mcp.tool() decorator and implements the core logic by instantiating SlackClient and delegating to its add_reaction method, returning JSON-formatted results.@mcp.tool() async def add_reaction(channel: str, timestamp: str, emoji_name: str) -> str: """ Add a reaction emoji to a message. Args: channel: Channel ID where the message exists timestamp: Timestamp of the message emoji_name: Name of the emoji (without colons) """ try: client = SlackClient() result = await client.add_reaction(channel, timestamp, emoji_name) return json.dumps(result, indent=2) except Exception as e: return json.dumps({"error": str(e)}, indent=2)
- slack_mcp/server.py:177-180 (helper)Helper method in SlackClient class that performs the actual Slack API call to add a reaction using the 'reactions.add' endpoint.async def add_reaction(self, channel: str, timestamp: str, name: str) -> Dict[str, Any]: """Add a reaction to a message.""" data = {"channel": channel, "timestamp": timestamp, "name": name} return await self._make_request("POST", "reactions.add", json_data=data)
- slack_mcp/server.py:410-410 (registration)The @mcp.tool() decorator registers the add_reaction function as an MCP tool.@mcp.tool()