Skip to main content
Glama

discord_remove_reaction

Remove a specific emoji reaction from a Discord message by specifying the channel ID, message ID, and emoji. Simplify moderation and user interaction management.

Instructions

Removes a specific emoji reaction from a Discord message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelIdYes
emojiYes
messageIdYes
userIdNo

Implementation Reference

  • The core handler function that executes the discord_remove_reaction tool. It fetches the channel and message, locates the specific reaction, and removes it either for a given userId or the bot itself using Discord.js API.
    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 || !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}` 
            }]
          };
        } else {
          // 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 schema definition including name, description, and input schema with required parameters: channelId, messageId, emoji; optional: userId.
    {
      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:153-156 (registration)
    Registers the tool handler in the MCP server's switch statement for call_tool requests, dispatching to removeReactionHandler.
    case "discord_remove_reaction":
      this.logClientState("before discord_remove_reaction handler");
      toolResponse = await removeReactionHandler(args, this.toolContext);
      return toolResponse;
  • Re-exports the removeReactionHandler from reactions.ts for use in the main server imports (captures import and export lines).
      addReactionHandler,
      addMultipleReactionsHandler,
      removeReactionHandler,
      deleteMessageHandler
    } from './reactions.js';
    import {
      createWebhookHandler,
      sendWebhookMessageHandler,
      editWebhookHandler,
      deleteWebhookHandler
    } from './webhooks.js';
    
    // Export tool handlers
    export {
      loginHandler,
      sendMessageHandler,
      getForumChannelsHandler,
      createForumPostHandler,
      getForumPostHandler,
      replyToForumHandler,
      deleteForumPostHandler,
      createTextChannelHandler,
      deleteChannelHandler,
      readMessagesHandler,
      getServerInfoHandler,
      addReactionHandler,
      addMultipleReactionsHandler,
      removeReactionHandler,
  • Imports the Zod validation schema RemoveReactionSchema used for parsing tool arguments in the handler.
    import { 
      AddReactionSchema, 
      AddMultipleReactionsSchema, 
      RemoveReactionSchema,
      DeleteMessageSchema
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 ('Removes') but lacks details on permissions required, whether it's reversible, rate limits, or error conditions. This is a significant gap for a mutation tool with zero annotation coverage.

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 front-loads the core action. It wastes no words and is appropriately sized for the tool's complexity, earning its place without unnecessary elaboration.

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 tool's mutation nature, no annotations, no output schema, and 0% schema description coverage, the description is incomplete. It lacks details on behavioral traits, parameter meanings, and usage context, making it inadequate for safe and effective tool 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?

Schema description coverage is 0%, so the description must compensate for undocumented parameters. It mentions 'emoji' and implies 'message' context, but doesn't explain the four parameters (channelId, emoji, messageId, userId) or their semantics, leaving them ambiguous without schema descriptions.

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 target ('a specific emoji reaction from a Discord message'), making the purpose immediately understandable. It distinguishes from siblings like 'discord_add_reaction' by specifying removal rather than addition, though it doesn't explicitly mention sibling differentiation.

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. The description doesn't mention prerequisites (e.g., needing permissions to remove reactions), context for usage, or comparisons with related 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

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

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