Skip to main content
Glama

discord_add_reaction

Add emoji reactions to Discord messages by specifying channel ID, message ID, and emoji. This tool enables users to interact with Discord content through reactions.

Instructions

Add a reaction to a message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelIdYesThe Discord channel ID
messageIdYesThe message ID to react to
emojiYesEmoji to react with (Unicode or custom emoji format)

Implementation Reference

  • Factory function returning the ToolHandler object for 'discord_add_reaction'. Includes input schema validation with Zod, policy check, calls DiscordClient.addReaction, and returns success response. This is the primary implementation of the tool logic.
    export function addReactionTool(dc: DiscordClient, policy: Policy): ToolHandler { const input = z.object({ channel_id: z.string(), message_id: z.string(), emoji: z.string() }); return { name: 'discord_add_reaction', description: 'Add a reaction emoji to a message.', inputSchema: input, async *handler({ input }: { input: any }){ const { channel_id, message_id, emoji } = input as any; if (!policy.allowChannel(channel_id)) throw new Error('Channel not allowed by policy'); await dc.addReaction(channel_id, message_id, emoji); yield { content: [{ type: 'text', text: 'ok' }] }; } }; }
  • DiscordClient helper method that performs the actual Discord REST API call to add a reaction to a message using the bot's own reaction endpoint.
    async addReaction(channelId: string, messageId: string, emoji: string): Promise<void> { await this.rest.put(Routes.channelMessageOwnReaction(channelId, messageId, emoji)); }
  • src/index.ts:153-153 (registration)
    Commented registration of the addReactionTool in the main server setup. Indicates that a generated version is used instead.
    // registerTool(addReactionTool(dc, policy)); // Using generated version instead

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/GustyCube/discord-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server