whatsapp_fetch_messages
Fetch cleaned WhatsApp messages from direct chats, groups, or channels by message cursor or time window, with resolved names, mentions, and reply context for analysis.
Instructions
Fetch cleaned WhatsApp messages across 1-on-1 direct chats, group chats, or channels by incremental cursor (after_msg_id) or time window (since). Automatically resolves real names, @lid identities, @mentions, 150-char reply chains, filters out revoked messages, and prepends context buffer.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"chat_ids": "<chat_ids>"
},
"name": "whatsapp_fetch_messages"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fresh | No | Force immediate SQLite online backup snapshot refresh. | |
| since | No | Relative duration (e.g. '12h', '24h', '7d') or ISO-8601 timestamp when after_msg_id is not set. | 24h |
| until | No | Optional upper bound ISO-8601 timestamp. | |
| format | No | markdown | |
| chat_ids | Yes | Array of WhatsApp chat_ids (@s.whatsapp.net, @lid, @g.us, @newsletter) or ['ALL_ALLOWED'] / ['ALL_DIRECT'] / ['ALL_GROUPS']. | |
| chat_type | No | Optional session type filter ('all', 'direct', 'group', 'newsletter'). | all |
| fold_noise | No | Fold consecutive short acknowledgment messages ('收到', 'OK', '+1') in markdown mode. | |
| after_msg_id | No | Global monotonic message cursor (Z_PK). Fetches only messages with msg_id > after_msg_id. | |
| context_buffer | No | Number of preceding history messages to include as context buffer (default 10). | |
| limit_per_chat | No | Max messages per chat session (default 500, max 3000). |