list_chats
Retrieve cached WhatsApp chats (individual and group) with optional name filter and sorting by recency or alphabetical order.
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 |
|---|---|---|---|
| include_last_message | No | if true, include each chat's most recent message in the result (defaults to true) | |
| limit | No | max chats to return (default 20) | |
| page | No | zero-based page index for paging through results (default 0) | |
| 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 |