add_reaction
Add emoji reactions to Slack messages using channel ID, timestamp, and emoji name to express responses or acknowledge content.
Instructions
Add an emoji reaction to a message
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| channel | Yes | Channel ID | |
| timestamp | Yes | Message timestamp | |
| name | Yes | Emoji name (without colons) |
Implementation Reference
- src/tools/reactions.ts:4-21 (handler)The core handler function that parses arguments using the schema, calls Slack's reactions.add API via the client wrapper, and returns a success response.export async function addReaction(client: SlackClientWrapper, args: unknown) { const params = addReactionSchema.parse(args); return await client.safeCall(async () => { await client.getClient().reactions.add({ channel: params.channel, timestamp: params.timestamp, name: params.name, }); return { ok: true, channel: params.channel, timestamp: params.timestamp, reaction: params.name, }; }); }
- src/utils/validators.ts:95-99 (schema)Zod schema defining the input parameters for the add_reaction tool: channel ID, message timestamp, and emoji name.export const addReactionSchema = z.object({ channel: channelIdSchema, timestamp: timestampSchema, name: emojiSchema, });
- src/index.ts:352-373 (registration)Tool specification registered for the list_tools endpoint, including name, description, and JSON schema matching the Zod schema.{ name: 'add_reaction', description: 'Add an emoji reaction to a message', inputSchema: { type: 'object', properties: { channel: { type: 'string', description: 'Channel ID', }, timestamp: { type: 'string', description: 'Message timestamp', }, name: { type: 'string', description: 'Emoji name (without colons)', }, }, required: ['channel', 'timestamp', 'name'], }, },
- src/index.ts:437-437 (registration)Handler mapping in the toolHandlers object that wires the 'add_reaction' tool name to the imported addReaction function.add_reaction: (args) => reactionTools.addReaction(slackClient, args),