read_chat_history
Reads a chat's latest messages, newest first: id, timestamp, sender and text (media as placeholders like "[voice note, 0:42]"; fetch the file with download_media, paid plan). Returns { chat, participants?, messages }: chat is the conversation and, in groups, participants maps each message's sender_jid to that sender, both with the contact fields (name; name_source: address_book, push_name, group_subject, business, phone or unresolved; canonical_jid: the JID to pass to send_message and read_chat_history; phone_jid and lid_jid: the chat's phone-number and LID forms, null when unknown or for groups; phone_display: the number as +). Covers about the last 90 days. jid can be a chat JID or a phone number. A message that was edited shows its latest text with edited: true. A voice note that was transcribed shows its text ("[voice note, 0:42, transcribed] "…""); to read one that wasn't, call transcribe_voice_note with its id (paid plan). A poll shows its vote count per option and number of voters, e.g. "[poll] Lunch? Options: Pizza (3) | Sushi (1) · 4 voters"; get_poll_results with its id says who voted for what (paid plan). A shared contact card has shared_contacts: [{ name, phone_jid, lid_jid, phone_display }], from the card; send_message takes phone_jid or lid_jid as to. A page holds up to limit messages but stops early when they are long; to go further back, pass the before the headline gives (the id of the oldest message shown). To reply to one of these messages, pass its id as quote_id to send_message (in groups, also its sender_jid as quote_participant). Get chat JIDs from get_recent_chats or search_contacts.
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": {
"jid": "<jid>",
"limit": "<limit>"
},
"name": "read_chat_history"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| jid | Yes | The chat: a JID (…@s.whatsapp.net, …@lid, …@g.us) or a phone number with country code. | |
| limit | Yes | Number of messages to return, newest first (e.g. 20; max 200). | |
| before | No | Optional. For older messages: the `id` of the oldest message of the previous page, as the headline gives it. The page then starts just before that message. |