Skip to main content
Glama
jar285

MCP-Discord

by jar285

discord_add_reaction

Add emoji reactions to Discord messages by specifying channel ID, message ID, and emoji. This tool enables AI assistants to interact with Discord platforms through the MCP-Discord server.

Instructions

Adds an emoji reaction to a specific Discord message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelIdYes
messageIdYes
emojiYes

Implementation Reference

  • The handler logic for the discord_add_reaction tool. It validates input with AddReactionSchema, checks client readiness, fetches the channel and message, adds the emoji reaction using Discord.js message.react(), and returns success or error response.
    case "discord_add_reaction": {
      const { channelId, messageId, emoji } = AddReactionSchema.parse(args);
      try {
        if (!client.isReady()) {
          return {
            content: [{ type: "text", text: "Discord client not logged in. Please use discord_login tool first." }],
            isError: true
          };
        }
    
        const channel = await client.channels.fetch(channelId);
        if (!channel || !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 {
          content: [{ type: "text", text: `Failed to add reaction: ${error}` }],
          isError: true
        };
      }
    }
  • Zod schema for input validation of discord_add_reaction tool parameters: channelId, messageId, emoji.
    const AddReactionSchema = z.object({
        channelId: z.string(),
        messageId: z.string(),
        emoji: z.string()
    });
  • src/index.ts:331-343 (registration)
    Tool registration in the ListTools response, including name, 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"]
      }
    },
  • Input schema definition in the tool registration for discord_add_reaction.
    inputSchema: {
      type: "object",
      properties: {
        channelId: { type: "string" },
        messageId: { type: "string" },
        emoji: { type: "string" }
      },
      required: ["channelId", "messageId", "emoji"]
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

C2.8/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It only states the action without disclosing behavioral details such as whether repeated reactions are idempotent, rate limits, or required permissions. This is a significant gap for a mutation tool.

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

Conciseness5/5

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

The description is a single clear sentence with no unnecessary words. It is perfectly concise and front-loads the core purpose.

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 the simplicity of the tool, the description covers the basic action but lacks any context about alternatives, prerequisites, or edge cases. The presence of sibling tools like remove_reaction and add_multiple_reactions makes the lack of usage guidance more impactful. Overall, it is minimally viable but incomplete.

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?

Schema description coverage is 0%, and the description does not explain the parameters beyond the action. It references 'emoji' but does not clarify the format (e.g., Unicode or custom emoji ID) or the roles of channelId and messageId, leaving the agent to infer from names.

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 specific resource ('emoji reaction to a specific Discord message'). It distinguishes from the sibling 'discord_add_multiple_reactions' by using singular 'an emoji reaction', though it does not explicitly name the alternative.

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?

The description provides no guidance on when to use this tool versus alternatives such as discord_add_multiple_reactions or discord_remove_reaction. It also does not mention prerequisites like requiring a prior login via discord_login.

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