Skip to main content
Glama
z9905080
by z9905080

slack_add_reaction

Add an emoji reaction to Slack messages using channel ID, message timestamp, and reaction name to express responses or acknowledge content.

Instructions

Add a reaction emoji to a message

Input Schema

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

Implementation Reference

  • Handler for the slack_add_reaction tool within the CallToolRequest switch statement. It validates input arguments and invokes the SlackClient.addReaction method to perform the action.
    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) }], }; }
  • Input schema and Tool definition for slack_add_reaction, specifying parameters channel_id, timestamp, and 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"], }, };
  • Core implementation in SlackClient class that makes the HTTP POST request to Slack's reactions.add API endpoint to add the reaction.
    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:570-580 (registration)
    Registration of the slack_add_reaction tool (referenced as addReactionTool) in the array returned by the ListToolsRequest handler.
    tools: [ listChannelsTool, postMessageTool, replyToThreadTool, addReactionTool, getChannelHistoryTool, getThreadRepliesTool, getUsersTool, getUserProfileTool, lookupUserByEmailTool, ],
  • TypeScript interface defining the arguments for the slack_add_reaction tool.
    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/z9905080/mcp-slack'

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