Skip to main content
Glama

discord_remove_reaction

Remove a specific emoji reaction from a Discord message by providing the channel ID, message ID, and emoji identifier. This tool helps manage reactions in Discord conversations.

Instructions

Removes a specific emoji reaction from a Discord message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelIdYes
messageIdYes
emojiYes
userIdNo

Implementation Reference

  • The main execution handler for the 'discord_remove_reaction' tool. Parses input arguments using RemoveReactionSchema, fetches the channel and message, locates the specific reaction, and removes it either for a specified user or the bot itself. Handles errors with handleDiscordError.
    export async function removeReactionHandler(
      args: unknown,
      context: ToolContext
    ): Promise<ToolResponse> {
      const { channelId, messageId, emoji, userId } =
        RemoveReactionSchema.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,
          };
        }
    
        // Get the reactions
        const reactions = message.reactions.cache;
    
        // Find the specific reaction
        const reaction = reactions.find(
          (r) => r.emoji.toString() === emoji || r.emoji.name === emoji
        );
    
        if (!reaction) {
          return {
            content: [
              {
                type: 'text',
                text: `Reaction ${emoji} not found on message ID: ${messageId}`,
              },
            ],
            isError: true,
          };
        }
    
        if (userId) {
          // Remove a specific user's reaction
          await reaction.users.remove(userId);
          return {
            content: [
              {
                type: 'text',
                text: `Successfully removed reaction ${emoji} from user ID: ${userId} on message ID: ${messageId}`,
              },
            ],
          };
        }
        // Remove bot's reaction
        await reaction.users.remove(context.client.user.id);
        return {
          content: [
            {
              type: 'text',
              text: `Successfully removed bot's reaction ${emoji} from message ID: ${messageId}`,
            },
          ],
        };
      } catch (error) {
        return handleDiscordError(error);
      }
    }
  • MCP tool definition including name, description, and input schema for 'discord_remove_reaction'.
    {
      name: 'discord_remove_reaction',
      description: 'Removes a specific emoji reaction from a Discord message',
      inputSchema: {
        type: 'object',
        properties: {
          channelId: { type: 'string' },
          messageId: { type: 'string' },
          emoji: { type: 'string' },
          userId: { type: 'string' },
        },
        required: ['channelId', 'messageId', 'emoji'],
      },
    },
  • src/server.ts:176-179 (registration)
    Registers and dispatches to the removeReactionHandler in the MCP server's CallToolRequest handler switch statement.
    case 'discord_remove_reaction':
      this.logClientState('before discord_remove_reaction handler');
      toolResponse = await removeReactionHandler(args, this.toolContext);
      return toolResponse;
  • Zod schema for runtime input validation used by the removeReactionHandler.
    export const RemoveReactionSchema = z.object({
      channelId: z.string(),
      messageId: z.string(),
      emoji: z.string(),
      userId: z.string().optional(),
    });
  • Re-exports the removeReactionHandler from reactions.ts for convenient import in server.ts.
    removeReactionHandler,
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action but doesn't cover critical aspects like required permissions, whether it's idempotent, error conditions, or what happens if the reaction doesn't exist. This leaves significant gaps for an agent to understand the tool's behavior.

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, direct sentence with zero wasted words. It's front-loaded with the core action and resource, making it highly efficient and easy to parse.

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, 0% schema coverage, and no output schema, the description is insufficient. It lacks details on parameters, behavioral traits, error handling, and output expectations, leaving the agent with minimal context to use the tool effectively.

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 details. It mentions 'emoji' and implies 'message' context, but doesn't explain any of the 4 parameters (channelId, messageId, emoji, userId) or their formats (e.g., emoji encoding, ID types). This is inadequate given the low 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 ('Removes') and the resource ('a specific emoji reaction from a Discord message'), making the purpose immediately understandable. It doesn't explicitly differentiate from siblings like 'discord_delete_message', but the focus on reactions provides some implicit distinction.

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, it doesn't mention prerequisites (e.g., needing permissions to remove reactions) or contrast with sibling tools like 'discord_delete_message' for broader message deletion.

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