get_conversations_from_the_last_day
Retrieve all WhatsApp conversations from the last 24 hours for a specified phone number. Supports marketing and messaging management within the platform’s free-form messaging window.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| phone_without_dialer_code | No | None |
Implementation Reference
- Core implementation of the tool: fetches WhatsApp conversations from the last 24 hours, optionally filtered by phone number, using TitanMind API.def get_conversations_from_the_last_day( phone_without_dialer_code: str = "None" ) -> Optional[Dict[str, Any]]: yesterday_datetime = datetime.now() - timedelta(days=1) payload = { "page": 1, "channel": "whatsapp", "last_message_at__gte": get_date_time_to_utc_server_time_format_string(yesterday_datetime) } if phone_without_dialer_code and phone_without_dialer_code.lower() not in ["none", "null"]: print(f"phone_without_dialer_code {phone_without_dialer_code}") payload["title__icontains"] = phone_without_dialer_code return asdict( TitanMindAPINetworking().make_request( endpoint=f"msg/conversations/", success_message="last 24 hours conversations fetched.", method=HTTPMethod.GET, payload=payload ) )
- src/titan_mind/server.py:73-87 (registration)MCP tool registration using @mcp.tool(). Includes docstring with workflow instructions. Delegates to the core handler in titan_mind_functions.py.@mcp.tool() def get_conversations_from_the_last_day( phone_without_dialer_code: str = "None" ) -> Optional[Dict[str, Any]]: (""" get all the conversation where there have been the last message sent or received in the last 24 hours. Args: phone_without_dialer_code (str): to filter conversation with a phone number. default is "None" to get all conversations. """ + _titan_mind_product_whatsapp_channel_messaging_functionality_and_workflow) return titan_mind_functions.get_conversations_from_the_last_day( phone_without_dialer_code )