Skip to main content
Glama
scarecr0w12

discord-mcp

add_reaction

Add emoji reactions to Discord messages by specifying server, channel, message IDs and emoji. React to messages programmatically within Discord servers.

Instructions

Add a reaction to a message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
guildIdYesThe ID of the server (guild)
channelIdYesThe ID of the channel
messageIdYesThe ID of the message
emojiYesThe emoji to react with (unicode or custom emoji ID)

Implementation Reference

  • Registration and implementation of the 'add_reaction' tool. Defines the input schema using Zod and the handler function that fetches the Discord channel and message, validates the channel type, and adds the specified emoji reaction using message.react(emoji). Returns success/error response.
    server.tool(
      'add_reaction',
      'Add a reaction to a message',
      {
        guildId: z.string().describe('The ID of the server (guild)'),
        channelId: z.string().describe('The ID of the channel'),
        messageId: z.string().describe('The ID of the message'),
        emoji: z.string().describe('The emoji to react with (unicode or custom emoji ID)'),
      },
      async ({ guildId, channelId, messageId, emoji }) => {
        const result = await withErrorHandling(async () => {
          const client = await getDiscordClient();
          const guild = await client.guilds.fetch(guildId);
          const channel = await guild.channels.fetch(channelId);
    
          if (!isMessageableChannel(channel)) {
            throw new Error('Channel does not support messages');
          }
    
          const message = await channel.messages.fetch(messageId);
          await message.react(emoji);
          return { messageId, emoji, message: 'Reaction added successfully' };
        });
    
        if (!result.success) {
          return { content: [{ type: 'text', text: result.error }], isError: true };
        }
    
        return { content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }] };
      }
    );
  • The core handler function for the add_reaction tool. It uses withErrorHandling to fetch the Discord guild, channel, and message, checks if the channel supports messages, adds the reaction with message.react(emoji), and formats the response.
    async ({ guildId, channelId, messageId, emoji }) => {
      const result = await withErrorHandling(async () => {
        const client = await getDiscordClient();
        const guild = await client.guilds.fetch(guildId);
        const channel = await guild.channels.fetch(channelId);
    
        if (!isMessageableChannel(channel)) {
          throw new Error('Channel does not support messages');
        }
    
        const message = await channel.messages.fetch(messageId);
        await message.react(emoji);
        return { messageId, emoji, message: 'Reaction added successfully' };
      });
    
      if (!result.success) {
        return { content: [{ type: 'text', text: result.error }], isError: true };
      }
    
      return { content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }] };
    }
  • Zod schema defining input parameters for the add_reaction tool: guildId, channelId, messageId, and emoji.
    {
      guildId: z.string().describe('The ID of the server (guild)'),
      channelId: z.string().describe('The ID of the channel'),
      messageId: z.string().describe('The ID of the message'),
      emoji: z.string().describe('The emoji to react with (unicode or custom emoji ID)'),
  • src/index.ts:59-59 (registration)
    Top-level registration call that includes the add_reaction tool by invoking registerMessageTools on the MCP server instance.
    registerMessageTools(server);
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 whether this requires specific permissions, rate limits, whether reactions are reversible, what happens if the emoji is invalid, or any error conditions.

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 with zero wasted words. It's appropriately sized for a straightforward tool and front-loads the essential information.

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?

For a mutation tool with no annotations and no output schema, the description is insufficient. It doesn't explain what happens after adding a reaction, what the response looks like, error conditions, or permissions needed. The context signals show this is a 4-parameter write operation that needs more behavioral disclosure.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all 4 parameters thoroughly. The description adds no additional parameter semantics beyond what's in the schema, meeting the baseline for high schema coverage.

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 ('add a reaction') and target ('to a message'), providing a specific verb+resource combination. However, it doesn't differentiate from sibling tools like 'remove_reactions' or 'edit_message' which might also involve message interactions.

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 'edit_message' for modifying messages or 'remove_reactions' for undoing reactions. There's no mention of prerequisites, permissions needed, or contextual constraints.

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

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