get_conversations_from_the_last_day
Retrieve WhatsApp conversations from the past 24 hours to monitor recent messaging activity and manage customer interactions within the permitted time window.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_conversations_from_the_last_day"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| phone_without_dialer_code | No | None |
Implementation Reference
- Core handler function that fetches conversations from the last 24 hours via API, optionally filtered by phone number.
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:74-86 (registration)MCP tool registration with @mcp.tool() decorator, including docstring and delegation to the core handler.
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 )