Skip to main content
Glama

discord_add_reaction

Add an emoji reaction to a specific Discord message using the channel ID, message ID, and emoji.

Instructions

Adds an emoji reaction to a specific Discord message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelIdYes
messageIdYes
emojiYes

Implementation Reference

  • The main handler function `addReactionHandler` that executes the tool logic: parses args with AddReactionSchema, checks Discord client readiness, fetches the channel, fetches the message, and calls `message.react(emoji)`. Returns success/error response.
    export async function addReactionHandler(
      args: unknown,
      context: ToolContext
    ): Promise<ToolResponse> {
      const { channelId, messageId, emoji } = AddReactionSchema.parse(args);
      try {
        if (!context.client.isReady()) {
          return {
            content: [{ type: 'text', text: 'Discord client not logged in.' }],
            isError: true,
          };
        }
    
        const channel = await context.client.channels.fetch(channelId);
        if (!(channel?.isTextBased() && 'messages' in channel)) {
          return {
            content: [
              {
                type: 'text',
                text: `Cannot find text channel with ID: ${channelId}`,
              },
            ],
            isError: true,
          };
        }
    
        const message = await channel.messages.fetch(messageId);
        if (!message) {
          return {
            content: [
              { type: 'text', text: `Cannot find message with ID: ${messageId}` },
            ],
            isError: true,
          };
        }
    
        // Add the reaction
        await message.react(emoji);
    
        return {
          content: [
            {
              type: 'text',
              text: `Successfully added reaction ${emoji} to message ID: ${messageId}`,
            },
          ],
        };
      } catch (error) {
        return handleDiscordError(error);
      }
    }
  • Zod schema `AddReactionSchema` defining input validation: channelId (string), messageId (string), emoji (string).
    export const AddReactionSchema = z.object({
      channelId: z.string(),
      messageId: z.string(),
      emoji: z.string(),
    });
  • Tool registration entry in `toolList`: name 'discord_add_reaction', description, and inputSchema matching the Zod schema.
    {
      name: 'discord_add_reaction',
      description: 'Adds an emoji reaction to a specific Discord message',
      inputSchema: {
        type: 'object',
        properties: {
          channelId: { type: 'string' },
          messageId: { type: 'string' },
          emoji: { type: 'string' },
        },
        required: ['channelId', 'messageId', 'emoji'],
      },
  • src/server.ts:161-164 (registration)
    Server-side registration: case 'discord_add_reaction' calls `addReactionHandler(args, this.toolContext)`.
    case 'discord_add_reaction':
      this.logClientState('before discord_add_reaction handler');
      toolResponse = await addReactionHandler(args, this.toolContext);
      return toolResponse;
  • Re-export of `addReactionHandler` from `./reactions.js` in the tools barrel module.
    export {
      addMultipleReactionsHandler,
      addReactionHandler,
      deleteMessageHandler,
      removeReactionHandler,
    } from './reactions.js';
    export { sendMessageHandler } from './send-message.js';
    export { ToolContext, ToolHandler, ToolResponse } from './types.js';
    export {
      createWebhookHandler,
      deleteWebhookHandler,
      editWebhookHandler,
      sendWebhookMessageHandler,
    } from './webhooks.js';
    
    import type { Client } from 'discord.js';
    import type { ToolContext } from './types.js';
    
    // Create tool context
    export function createToolContext(client: Client): ToolContext {
      return { client };
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must bear the burden of behavioral disclosure. However, it only states the surface action ('adds an emoji reaction') without revealing any behavioral traits such as whether the reaction is case-sensitive, what happens if the emoji is invalid, or if the user needs specific permissions. The agent gains little beyond the obvious.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single short sentence with no unnecessary words. However, it is too terse; it could include minimal parameter guidance without harming conciseness. It earns a middle score for being concise but not optimally informative.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given that the tool has 3 required parameters and no output schema, the description should clarify parameter semantics and perhaps the return value (e.g., success indication). It does neither, leaving gaps for an AI agent. The sibling tool set is large, but the description fails to provide sufficient context for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 3 parameters (channelId, messageId, emoji) with 0% description coverage. The description does not explain the expected format for 'emoji' (e.g., standard Unicode string vs. custom Discord emoji ID) or any constraints. The agent must rely on parameter names alone, which is insufficient.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('adds') and the resource ('emoji reaction to a specific Discord message'). It implicitly distinguishes from siblings like discord_remove_reaction and discord_add_multiple_reactions, though it could explicitly name them for clarity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. For example, there is no mention that to add multiple reactions at once, one should use discord_add_multiple_reactions. The agent must infer usage from tool names.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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

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