list_messages
Search and page through cached WhatsApp messages by chat, sender, time range, or text substring, with optional surrounding context. Read-only and works offline from the local cache.
Instructions
(reads local cache; works while disconnected) Search and page through cached WhatsApp messages, optionally filtering by chat, sender, time range, and substring; can include surrounding context messages. Read-only; no side effects. Use get_message_context to expand around a single known message ID, or request_sync to backfill missing history. Returns a human-readable formatted text block listing matching messages; edited messages show an [edited] marker and messages deleted for everyone keep their text behind a [deleted <time> UTC] marker.
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": "list_messages"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | zero-based page index for paging through results (default 0) | |
| after | No | ISO-8601 UTC lower bound on message timestamp (inclusive) | |
| limit | No | max messages to return (default 20, capped at 100 server-side) | |
| query | No | case-insensitive substring to match within message body (text, or the caption of an image, video or document; edited messages match their latest text; messages deleted for everyone still match) | |
| before | No | ISO-8601 UTC upper bound on message timestamp (inclusive) | |
| chat_jid | No | filter to messages in this chat (WhatsApp JID: individual as `<digits>@s.whatsapp.net` or bare phone digits, group as `<digits>-<timestamp>@g.us`) | |
| context_after | No | messages to include after each match (default 1, capped at 20 server-side) | |
| context_before | No | messages to include before each match (default 1, capped at 20 server-side) | |
| include_context | No | if true, attach a few surrounding messages to each match (defaults to true) | |
| sender_phone_number | No | filter to messages sent by this phone or JID (WhatsApp JID: individual as `<digits>@s.whatsapp.net` or bare phone digits, group as `<digits>-<timestamp>@g.us`) |