Skip to main content
Glama
jar285

MCP-Discord

by jar285

discord_remove_reaction

Remove an emoji reaction from a Discord message by specifying the channel, message ID, and emoji to manage reactions in Discord servers.

Instructions

Removes a specific emoji reaction from a Discord message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelIdYes
messageIdYes
emojiYes
userIdNo

Implementation Reference

  • Handler function that fetches the channel and message, locates the specific reaction by emoji, and removes it either for a specified userId or the bot's own reaction. Returns success or error messages.
    case "discord_remove_reaction": {
      const { channelId, messageId, emoji, userId } = RemoveReactionSchema.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
          };
        }
    
        // 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(client.user.id);
          return {
            content: [{ 
              type: "text", 
              text: `Successfully removed bot's reaction ${emoji} from message ID: ${messageId}` 
            }]
          };
        }
      } catch (error) {
        return {
          content: [{ type: "text", text: `Failed to remove reaction: ${error}` }],
          isError: true
        };
      }
    }
  • Zod schema defining input parameters for the discord_remove_reaction tool: channelId, messageId, emoji (required), userId (optional). Used for validation in the handler.
    const RemoveReactionSchema = z.object({
        channelId: z.string(),
        messageId: z.string(),
        emoji: z.string(),
        userId: z.string().optional()
    });
  • src/index.ts:360-372 (registration)
    Tool registration in the MCP server's listTools handler, providing name, description, and JSON inputSchema for client-side validation.
    {
      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"]
      }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.1/5.0
Behavior2/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It only states the core action without explaining important behaviors such as whether it can remove reactions from other users, what happens if the reaction does not exist, or whether special permissions are required. The optional 'userId' parameter's role in removing others' reactions is not disclosed.

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 wasted words. It is front-loaded with the verb 'Removes' and immediately specifies the resource. It is appropriately concise for a simple operation.

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?

The tool has no output schema and no annotations, yet the description provides no additional context about return values, error handling, permissions, or edge cases. The optional 'userId' parameter is left unexplained, making the description incomplete for a tool with four parameters and zero schema documentation.

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

Parameters1/5

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

The schema has 0% description coverage, and the description itself provides no parameter explanations. It does not clarify the meaning of 'channelId', 'messageId', 'emoji', or especially the optional 'userId'. The description adds no value beyond the parameter names, leaving all four parameters semantically undocumented.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/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'). It distinguishes itself from sibling tools like discord_add_reaction and discord_delete_message by specifying the precise operation of removing a single reaction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when to use this tool (when a specific emoji reaction needs to be removed), but it does not provide explicit alternatives or exclusions. There is no mention of when not to use it, such as when removing all reactions or when needing to delete the entire message, which would be handled by sibling tools.

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