waha_star_message
Mark messages as starred or remove star status in WhatsApp chats to organize important conversations and highlight key information.
Instructions
Star or unstar a message.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chatId | Yes | Chat ID (format: number@c.us) | |
| messageId | Yes | Message ID to star/unstar | |
| star | Yes | True to star the message, false to unstar |
Implementation Reference
- src/index.ts:1834-1867 (handler)Executes the waha_star_message tool by validating input parameters, calling the WAHAClient.starMessage method, and returning a formatted success response.private async handleStarMessage(args: any) { const chatId = args.chatId; const messageId = args.messageId; const star = args.star; if (!chatId) { throw new Error("chatId is required"); } if (!messageId) { throw new Error("messageId is required"); } if (star === undefined) { throw new Error("star is required"); } await this.wahaClient.starMessage({ chatId, messageId, star, }); return { content: [ { type: "text", text: star ? `Successfully starred message ${messageId} in chat ${chatId}.` : `Successfully unstarred message ${messageId} in chat ${chatId}.`, }, ], }; }
- src/client/waha-client.ts:715-742 (helper)Underlying WAHA API client method that performs the HTTP PUT request to star or unstar the specified message in the WAHA WhatsApp HTTP API.async starMessage(params: { chatId: string; messageId: string; star: boolean; }): Promise<void> { const { chatId, messageId, star } = params; if (!chatId) { throw new WAHAError("chatId is required"); } if (!messageId) { throw new WAHAError("messageId is required"); } const endpoint = `/api/${this.session}/chats/${encodeURIComponent( chatId )}/messages/${encodeURIComponent(messageId)}/star`; const body = { star, }; await this.request<void>(endpoint, { method: "PUT", body: JSON.stringify(body), }); }
- src/index.ts:494-514 (schema)JSON schema defining the input parameters, types, descriptions, and required fields for the waha_star_message tool.name: "waha_star_message", description: "Star or unstar a message.", inputSchema: { type: "object", properties: { chatId: { type: "string", description: "Chat ID (format: number@c.us)", }, messageId: { type: "string", description: "Message ID to star/unstar", }, star: { type: "boolean", description: "True to star the message, false to unstar", }, }, required: ["chatId", "messageId", "star"], }, },
- src/index.ts:1089-1090 (registration)Registration of the tool handler in the MCP CallToolRequestSchema switch statement, dispatching calls to handleStarMessage.case "waha_star_message": return await this.handleStarMessage(args);