Skip to main content
Glama
zencoderai

Slack

by zencoderai

slack_add_reaction

Add emoji reactions to Slack messages to acknowledge, respond, or categorize content in channels using channel ID, message timestamp, and emoji name.

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

  • MCP tool handler for slack_add_reaction that invokes the SlackClient addReaction method and formats the response as MCP content.
    async ({ channel_id, timestamp, reaction }) => {
      const response = await slackClient.addReaction(channel_id, timestamp, reaction);
      return {
        content: [{ type: "text", text: JSON.stringify(response) }],
      };
    }
  • Zod input schema defining parameters for the slack_add_reaction tool.
    inputSchema: {
      channel_id: z.string().describe("The ID of the channel containing the message"),
      timestamp: z.string().describe("The timestamp of the message to react to"),
      reaction: z.string().describe("The name of the emoji reaction (without ::)"),
    },
  • index.ts:285-302 (registration)
    Registration of the slack_add_reaction tool with schema and handler on the MCP server.
    server.registerTool(
      "slack_add_reaction",
      {
        title: "Add Slack Reaction",
        description: "Add a reaction emoji to a message",
        inputSchema: {
          channel_id: z.string().describe("The ID of the channel containing the message"),
          timestamp: z.string().describe("The timestamp of the message to react to"),
          reaction: z.string().describe("The name of the emoji reaction (without ::)"),
        },
      },
      async ({ channel_id, timestamp, reaction }) => {
        const response = await slackClient.addReaction(channel_id, timestamp, reaction);
        return {
          content: [{ type: "text", text: JSON.stringify(response) }],
        };
      }
    );
  • SlackClient.addReaction helper method implementing the Slack API call to add a reaction to a 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();
    }
  • TypeScript interface defining the argument types for the addReaction method.
    interface AddReactionArgs {
      channel_id: string;
      timestamp: string;
      reaction: string;
    }

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

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