List messages
list_messagesList stored WhatsApp messages newest first, filtered by chat, sender, date range, or full-text query. Supports pagination and optional neighbouring-message context for each hit.
Instructions
List stored WhatsApp messages, newest first, optionally filtered by chat, sender, date range and a full-text query (words matched by prefix, accent- and case-insensitive). Results are paginated: pass next_cursor back as cursor while has_more is true. Set include_context to get the neighbouring messages of each hit.
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 |
|---|---|---|---|
| after | No | only messages after this ISO-8601 date or datetime | |
| limit | No | page size (default 20, max 200) | |
| query | No | full-text search; words are matched by prefix, accent- and case-insensitively | |
| before | No | only messages before this ISO-8601 date or datetime | |
| cursor | No | next_cursor from the previous page | |
| sender | No | only messages from this person: phone number, JID or contact name | |
| chat_jid | No | only messages of this chat (JID from list_chats or search_contacts) | |
| context_after | No | messages after each result when include_context is true (default 1) | |
| context_before | No | messages before each result when include_context is true (default 1) | |
| include_context | No | attach neighbouring messages to each result (default false) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| has_more | Yes | ||
| messages | Yes | ||
| next_cursor | No |