list_chats
Retrieve cached WhatsApp chats (1:1 and groups) filtered by name substring and sorted by recency or alphabetically. Optionally includes each chat's most recent message.
Instructions
(reads local cache; works while disconnected) List cached WhatsApp chats (1:1 and group), optionally filtered by name substring and sorted by recency or alphabetic name. Read-only; no side effects. Use get_chat for a single chat by JID, list_groups for groups only. Returns a JSON array of chat objects (each with JID, name, last-message metadata when requested).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | zero-based page index for paging through results (default 0) | |
| limit | No | max chats to return (default 20) | |
| query | No | case-insensitive substring to match against chat name | |
| sort_by | No | sort order: `last_active` (most-recent first, default) or `name` (alphabetic) | last_active |
| include_last_message | No | if true, include each chat's most recent message in the result (defaults to true) |