mark_message_as_read
Update WhatsApp message status to read by providing the message ID, helping manage conversation flow and track message delivery status.
Instructions
Mark a message as read.
Args: message_id: The WhatsApp message ID to mark as read sender: Optional phone ID
Returns: Dictionary with success status
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| message_id | Yes | ||
| sender | No |
Implementation Reference
- tools/messaging.py:433-460 (handler)Main handler function for mark_message_as_read tool. Decorated with @mcp.tool() for registration, it accepts message_id (required) and sender (optional) parameters, calls wa_client.mark_message_as_read() to perform the actual WhatsApp API call, and returns a success/error response with logging.@mcp.tool() async def mark_message_as_read( message_id: str, *, sender: Optional[str] = None, ) -> dict: """ Mark a message as read. Args: message_id: The WhatsApp message ID to mark as read sender: Optional phone ID Returns: Dictionary with success status """ try: result = wa_client.mark_message_as_read( message_id=message_id, sender=sender, ) logger.info(f"Message {message_id} marked as read") result_data = str(result) if result else None return {"success": True, "result": result_data} except Exception as e: logger.error(f"Failed to mark message as read: {str(e)}") return {"success": False, "error": str(e)}