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
| 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:296-301 (handler)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) }], }; }
- index.ts:290-294 (schema)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) }], }; } );
- index.ts:142-158 (helper)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(); }
- index.ts:28-32 (schema)TypeScript interface defining the argument types for the addReaction method.interface AddReactionArgs { channel_id: string; timestamp: string; reaction: string; }