Skip to main content
Glama
z9905080

MCP Server for Slack

by z9905080

slack_add_reaction

Add emoji reactions to Slack messages to acknowledge responses, show agreement, or provide quick feedback in conversations.

Instructions

Add a reaction emoji to a message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channel_idYesThe ID of the channel containing the message
timestampYesThe timestamp of the message to react to
reactionYesThe name of the emoji reaction (without ::)

Implementation Reference

  • Executes the slack_add_reaction tool by validating arguments and calling the SlackClient.addReaction method.
    case "slack_add_reaction": {
      const args = request.params.arguments as unknown as AddReactionArgs;
      if (!args.channel_id || !args.timestamp || !args.reaction) {
        throw new Error(
          "Missing required arguments: channel_id, timestamp, and reaction",
        );
      }
      const response = await slackClient.addReaction(
        args.channel_id,
        args.timestamp,
        args.reaction,
      );
      return {
        content: [{ type: "text", text: JSON.stringify(response) }],
      };
    }
  • Defines the tool schema, name, description, and input schema for slack_add_reaction.
    const addReactionTool: Tool = {
      name: "slack_add_reaction",
      description: "Add a reaction emoji to a message",
      inputSchema: {
        type: "object",
        properties: {
          channel_id: {
            type: "string",
            description: "The ID of the channel containing the message",
          },
          timestamp: {
            type: "string",
            description: "The timestamp of the message to react to",
          },
          reaction: {
            type: "string",
            description: "The name of the emoji reaction (without ::)",
          },
        },
        required: ["channel_id", "timestamp", "reaction"],
      },
    };
  • index.ts:570-580 (registration)
    Registers the slack_add_reaction tool (as addReactionTool) in the list of available tools returned by ListToolsRequest.
    tools: [
      listChannelsTool,
      postMessageTool,
      replyToThreadTool,
      addReactionTool,
      getChannelHistoryTool,
      getThreadRepliesTool,
      getUsersTool,
      getUserProfileTool,
      lookupUserByEmailTool,
    ],
  • SlackClient method that performs the actual API call to add a reaction to a Slack message.
    async addReaction(
      channel_id: string,
      timestamp: string,
      reaction: string,
    ): Promise<any> {
      const response = await fetch("https://slack.com/api/reactions.add", {
        method: "POST",
        headers: this.botHeaders,
        body: JSON.stringify({
          channel: channel_id,
          timestamp: timestamp,
          name: reaction,
        }),
      });
    
      return response.json();
    }

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/z9905080/mcp-slack'

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