indicate_typing
Display a typing indicator in WhatsApp conversations to signal active response preparation, improving user experience during brief response delays.
Instructions
Show typing indicator to WhatsApp user.
This marks a message as read and displays a typing indicator to show the user that you are preparing a response. Best practice when it will take a few seconds to respond.
IMPORTANT NOTES:
Typing indicator lasts max 25 seconds or until you send a message
Only use if you are actually going to respond
Will be dismissed when you send the next message
Improves user experience for delayed responses
EXAMPLE: { "message_id": "wamid.HBgNMjc2NTY4NjY5MDUVAgARGBI5QTNDMEM3RjVBMzY2Q0Y4AA==" }
Args: message_id: The WhatsApp message ID to respond to (from incoming message) sender: Optional phone ID (defaults to client's phone ID)
Returns: Dictionary with success status
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| message_id | Yes | ||
| sender | No |
Implementation Reference
- tools/messaging.py:463-511 (handler)The indicate_typing tool handler function that shows a typing indicator to WhatsApp users. It takes a message_id and optional sender parameter, calls wa_client.indicate_typing(), and returns a success status dictionary. The function includes comprehensive documentation about the typing indicator's behavior (max 25 seconds, dismissed on message send, best practices).@mcp.tool() async def indicate_typing( message_id: str, *, sender: Optional[str] = None, ) -> dict: """ Show typing indicator to WhatsApp user. This marks a message as read and displays a typing indicator to show the user that you are preparing a response. Best practice when it will take a few seconds to respond. IMPORTANT NOTES: - Typing indicator lasts max 25 seconds or until you send a message - Only use if you are actually going to respond - Will be dismissed when you send the next message - Improves user experience for delayed responses EXAMPLE: { "message_id": "wamid.HBgNMjc2NTY4NjY5MDUVAgARGBI5QTNDMEM3RjVBMzY2Q0Y4AA==" } Args: message_id: The WhatsApp message ID to respond to (from incoming message) sender: Optional phone ID (defaults to client's phone ID) Returns: Dictionary with success status """ try: result = wa_client.indicate_typing( message_id=message_id, sender=sender, ) logger.info(f"Typing indicator shown for message {message_id}") # SuccessResult has a success boolean attribute success_status = getattr(result, 'success', bool(result)) return { "success": True, "typing_indicated": success_status, "message_id": message_id } except Exception as e: logger.error(f"Failed to indicate typing: {str(e)}") return {"success": False, "error": str(e)}