Get Message Context
wa_get_message_contextRead the messages around one message in its conversation — the message itself plus the few just before and after it, oldest first — in a single call. Name the message by WhatsApp's message_id (as a webhook delivery or wa_list_messages gave it) or by its cursor, and optionally how many to return on each side (before/after, 1-50, default 5). Use it to see what a message a webhook announced is replying to, or to read the exchange around a message before you act on it, without paging.
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": "wa_get_message_context"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| after | No | how many messages just after it to return, 1-50; defaults to 5 | |
| before | No | how many messages just before it to return, 1-50; defaults to 5 | |
| cursor | No | the message's cursor, as wa_list_messages returned it (a webhook delivery carries it as message_seq). Pass this or message_id | |
| account_id | No | the account the message belongs to, from wa_list_accounts; omit it when the workspace has only one account | |
| message_id | No | WhatsApp's id for the message to read around — the message_id a webhook delivery, wa_list_messages or wa_send_message gave you. Pass this or cursor | |
| include_history | No | also include imported history (pairing sync, wa_load_history) as neighbours; on automatically when the message itself is history. Off by default, so a live message's neighbours are the live conversation | |
| include_media_urls | No | also return attachment.media_url on each available attachment — a time-limited (1h) signed URL to GET the bytes with plain HTTP instead of a wa_get_media call; off by default |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| after | Yes | the messages just after it in the same conversation, oldest first; fewer than asked when the message is near the end of the chat | |
| before | Yes | the messages just before it in the same conversation, oldest first; fewer than asked when the message is near the start of the chat | |
| message | No | the message at the centre of the window; absent when the request was declined | |
| refusal | No | present only when the request was declined — including when no such message is stored | |
| account_notices | No | present when a number this read covers is not working: new messages are not arriving on it; says why and what to do |