Skip to main content
Glama

discord_add_reaction

React to a specific message in a Discord channel by providing the channel ID, message ID, and emoji. Simplify interaction and engagement in Discord conversations using this tool.

Instructions

Add a reaction to a message

Input Schema

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

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "channelId": { "description": "The Discord channel ID", "type": "string" }, "emoji": { "description": "Emoji to react with (Unicode or custom emoji format)", "type": "string" }, "messageId": { "description": "The message ID to react to", "type": "string" } }, "required": [ "channelId", "messageId", "emoji" ], "type": "object" }

Implementation Reference

  • The main handler function for the 'discord_add_reaction' tool. It extracts input parameters, checks channel policy, calls DiscordClient.addReaction, and yields a success response.
    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' }] }; }
  • Zod schema defining the input for the tool: channel_id, message_id, and emoji as strings.
    const input = z.object({ channel_id: z.string(), message_id: z.string(), emoji: z.string() });
  • The factory function that returns the ToolHandler object for 'discord_add_reaction', including name, description, schema, and handler. This is imported in src/index.ts but registration is commented out in favor of generated version.
    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' }] }; } }; }
  • Supporting method in DiscordClient that performs the actual REST API call to add a reaction to a message.
    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)
    Location in src/index.ts where the tool would be registered using registerTool, but commented out to use generated version 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