Skip to main content
Glama

discord_add_reaction

Add emoji reactions to Discord messages using channel ID, message ID, and emoji identifier to express responses or interactions.

Instructions

Adds an emoji reaction to a specific Discord message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelIdYes
messageIdYes
emojiYes

Implementation Reference

  • The main execution logic for the 'discord_add_reaction' tool. Parses input args with AddReactionSchema, checks client readiness, fetches the Discord channel and message, adds the reaction using message.react(emoji), and returns a success or 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);
      }
    }
  • MCP protocol tool registration including the name, description, and JSON schema for input validation (channelId, messageId, emoji).
    {
      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'],
      },
    },
  • Zod runtime validation schema (AddReactionSchema) used inside the handler to parse and validate arguments.
    export const AddReactionSchema = z.object({
      channelId: z.string(),
      messageId: z.string(),
      emoji: z.string(),
    });
  • src/server.ts:161-164 (registration)
    Server-side dispatch case that invokes the addReactionHandler upon receiving a 'discord_add_reaction' tool call.
    case 'discord_add_reaction':
      this.logClientState('before discord_add_reaction handler');
      toolResponse = await addReactionHandler(args, this.toolContext);
      return toolResponse;
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the basic action without disclosing behavioral traits. It doesn't mention permissions required (e.g., 'Add Reactions' permission in Discord), rate limits, whether reactions are idempotent, or what happens on failure (e.g., if emoji is invalid).

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, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, with every part earning its place.

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 3 parameters with 0% schema coverage, no annotations, and no output schema, the description is incomplete. It lacks details on parameter meanings, behavioral context (like permissions or errors), and doesn't mention what the tool returns (e.g., success confirmation or error).

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%, so the description must compensate but adds no parameter semantics. It doesn't explain what 'channelId', 'messageId', or 'emoji' represent (e.g., Discord snowflake IDs, emoji format like ':smile:'), leaving parameters undocumented beyond their names and types.

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 verb ('Adds') and resource ('emoji reaction to a specific Discord message'), making the purpose immediately understandable. However, it doesn't differentiate from its sibling 'discord_add_multiple_reactions' or 'discord_remove_reaction', which would require a 5.

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 like 'discord_add_multiple_reactions' for multiple reactions or 'discord_remove_reaction' for removal. It also lacks context about prerequisites (e.g., needing message access) or exclusions.

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