add_reaction
Add emoji reactions to Discord messages by specifying channel ID, message ID, and emoji to interact with content.
Instructions
Add a reaction to a specific message.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| channel_id | Yes | ||
| message_id | Yes | ||
| emoji | Yes |
Implementation Reference
- The main handler function that executes the 'add_reaction' tool. It fetches the specified channel and message, adds the given emoji as a reaction, and returns a confirmation message.async def handle_add_reaction(discord_client, arguments: Dict[str, Any]) -> List[TextContent]: """Add a reaction to a message""" channel = await discord_client.fetch_channel(int(arguments["channel_id"])) message = await channel.fetch_message(int(arguments["message_id"])) emoji = arguments["emoji"] await message.add_reaction(emoji) return [TextContent( type="text", text=f"Added reaction {emoji} to message in #{channel.name}" )]
- src/discord_mcp/integrated_server.py:771-792 (registration)Registers the 'add_reaction' tool with the MCP server in the list_tools() function, defining its name, description, and input schema.Tool( name="add_reaction", description="Add a reaction to a message", inputSchema={ "type": "object", "properties": { "channel_id": { "type": "string", "description": "Channel containing the message" }, "message_id": { "type": "string", "description": "Message to react to" }, "emoji": { "type": "string", "description": "Emoji to react with (Unicode or custom emoji ID)" } }, "required": ["channel_id", "message_id", "emoji"] } ),
- src/discord_mcp/integrated_server.py:1022-1032 (registration)Part of the tool dispatch logic in call_tool() that routes 'add_reaction' calls to CoreToolHandlers.handle_add_reaction."get_server_info", "list_servers", "get_channels", "list_members", "get_user_info", "send_message", "read_messages", "add_reaction", "add_multiple_reactions", "remove_reaction", "moderate_message", "create_text_channel", "delete_channel", "add_role", "remove_role" ] if name in core_tool_names: handler_method = f"handle_{name}" if hasattr(CoreToolHandlers, handler_method): return await getattr(CoreToolHandlers, handler_method)(discord_client, arguments)
- Defines the input schema for the 'add_reaction' tool, specifying required parameters: channel_id, message_id, and emoji.inputSchema={ "type": "object", "properties": { "channel_id": { "type": "string", "description": "Channel containing the message" }, "message_id": { "type": "string", "description": "Message to react to" }, "emoji": { "type": "string", "description": "Emoji to react with (Unicode or custom emoji ID)" } }, "required": ["channel_id", "message_id", "emoji"] }