Add Slack Reaction
slack_add_reactionAdd a reaction emoji to a Slack message. Specify the channel ID, message timestamp, and emoji name to react instantly.
Instructions
Add a reaction emoji to a message
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| channel_id | Yes | The ID of the channel containing the message | |
| timestamp | Yes | The timestamp of the message to react to | |
| reaction | Yes | The name of the emoji reaction (without ::) |
Implementation Reference
- index.ts:28-32 (schema)Type definition AddReactionArgs for the slack_add_reaction tool input parameters (channel_id, timestamp, reaction).
interface AddReactionArgs { channel_id: string; timestamp: string; reaction: string; } - index.ts:285-302 (registration)Registration of the slack_add_reaction tool with server.registerTool, including title, description, and Zod inputSchema.
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) }], }; } ); - index.ts:296-301 (handler)Handler function that receives channel_id, timestamp, reaction and calls slackClient.addReaction(), returning the response.
async ({ channel_id, timestamp, reaction }) => { const response = await slackClient.addReaction(channel_id, timestamp, reaction); return { content: [{ type: "text", text: JSON.stringify(response) }], }; } - index.ts:142-158 (helper)Helper method addReaction on SlackClient class that calls Slack API reactions.add with channel, timestamp, and reaction name.
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(); }