zulip_add_reaction
Add emoji reactions to messages in Zulip workspaces using message IDs and emoji names to enhance communication and express responses visually.
Instructions
Add an emoji reaction to a message
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| message_id | Yes | The ID of the message to react to | |
| emoji_name | Yes | Emoji name without colons |
Implementation Reference
- index.ts:453-467 (handler)Switch case in CallToolRequest handler that executes the zulip_add_reaction tool by validating arguments and calling ZulipClient.addReaction method.case "zulip_add_reaction": { const args = request.params.arguments as unknown as AddReactionArgs; if (args.message_id === undefined || !args.emoji_name) { throw new Error( "Missing required arguments: message_id and emoji_name" ); } const response = await zulipClient.addReaction( args.message_id, args.emoji_name ); return { content: [{ type: "text", text: JSON.stringify(response) }], }; }
- index.ts:137-154 (schema)Tool schema definition including name, description, and input schema for zulip_add_reaction.const addReactionTool: Tool = { name: "zulip_add_reaction", description: "Add an emoji reaction to a message", inputSchema: { type: "object", properties: { message_id: { type: "number", description: "The ID of the message to react to", }, emoji_name: { type: "string", description: "Emoji name without colons", }, }, required: ["message_id", "emoji_name"], }, };
- index.ts:294-304 (helper)ZulipClient method that performs the actual API call to add a reaction to a message.async addReaction(messageId: number, emojiName: string) { try { return await this.client.reactions.add({ message_id: messageId, emoji_name: emojiName, }); } catch (error) { console.error("Error adding reaction:", error); throw error; } }
- index.ts:46-48 (schema)TypeScript interface defining the input arguments for the zulip_add_reaction tool.interface AddReactionArgs { message_id: number; emoji_name: string;
- index.ts:542-542 (registration)Inclusion of the zulip_add_reaction tool in the list of tools returned by ListToolsRequest handler.addReactionTool,