whatsapp_star_message
Mark important WhatsApp messages with stars to organize conversations and highlight key information within chats.
Instructions
Star or unstar a message.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| messageId | Yes | ID of the message to star | |
| chatId | Yes | Chat ID where the message is located | |
| senderId | Yes | ID of the message sender |
Implementation Reference
- src/tools/messaging.ts:497-538 (handler)The complete ToolHandler implementation for the 'whatsapp_star_message' tool, including name, description, input schema (for MCP), and the async handler function that validates input and calls the WSAPI to star/unstar the message.export const starMessage: ToolHandler = { name: 'whatsapp_star_message', description: 'Star or unstar a message.', inputSchema: { type: 'object', properties: { messageId: { type: 'string', description: 'ID of the message to star', }, chatId: { type: 'string', description: 'Chat ID where the message is located', }, senderId: { type: 'string', description: 'ID of the message sender', }, }, required: ['messageId', 'chatId', 'senderId'], }, handler: async (args: any) => { const input = validateInput(starMessageSchema, args); logger.info('Starring message', { messageId: input.messageId, chatId: input.chatId, }); await wsapiClient.put(`/messages/${input.messageId}/star`, { chatId: input.chatId, senderId: input.senderId, }); logger.info('Message starred successfully', { messageId: input.messageId }); return { success: true, message: 'Message starred successfully', }; }, };
- src/validation/schemas.ts:166-170 (schema)Zod schema used for input validation in the starMessage handler, defining required fields: messageId, chatId, senderId.export const starMessageSchema = z.object({ messageId: messageIdSchema, chatId: chatIdSchema, senderId: phoneNumberSchema, });
- src/server.ts:53-79 (registration)Registration of all tools including messagingTools (which contains whatsapp_star_message) into the server's tools Map during server initialization.private setupToolHandlers(): void { logger.info('Setting up tool handlers'); // Register all tool categories const toolCategories = [ messagingTools, contactTools, groupTools, chatTools, sessionTools, instanceTools, accountTools, ]; toolCategories.forEach(category => { Object.values(category).forEach(tool => { if (this.tools.has(tool.name)) { logger.warn(`Tool ${tool.name} already registered, skipping`); return; } this.tools.set(tool.name, tool); logger.debug(`Registered tool: ${tool.name}`); }); }); logger.info(`Registered ${this.tools.size} tools`); }
- src/tools/messaging.ts:544-555 (registration)Export of messagingTools object that bundles the starMessage tool handler for registration in the server.export const messagingTools = { sendTextMessage, sendImageMessage, sendVideoMessage, sendLinkMessage, sendReactionMessage, editMessage, deleteMessage, markMessageAsRead, starMessage, ...advancedMessagingTools, };