Skip to main content
Glama

read_chat_history

Read-only

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

NameRequiredDescriptionDefault
jidYesThe chat: a JID (…@s.whatsapp.net, …@lid, …@g.us) or a phone number with country code.
limitYesNumber of messages to return, newest first (e.g. 20; max 200).
beforeNoOptional. 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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations only cover readOnlyHint and openWorldHint=false, but the description adds substantial behavior: the ~90-day history ceiling, the fact that a page stops early when messages are long, paid-plan requirements for media download and transcription, and how edits, transcriptions, polls, and contact cards are surfaced. This is exactly the kind of context annotations cannot carry.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core action and return shape are front-loaded in the first two sentences, and nearly every subsequent clause carries non-obvious information. However, it is delivered as one very long undifferentiated block mixing return-value documentation, follow-up tool routing, and pagination, which makes it harder to scan than a short bulleted structure would be.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description fully carries the burden of explaining the return payload ({ chat, participants?, messages }), field meanings, canonical_jid vs phone_jid/lid_jid, and per-message-type rendering. For a read tool with three parameters and non-trivial response shapes, an agent has everything needed to call it and interpret the result.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds real meaning beyond it: `limit` is characterized as an upper bound that the server may undershoot when messages are long, `jid` is framed as acceptable in either JID or phone-number form with sourcing advice, and `before` is tied to the returned headline rather than an arbitrary timestamp. The duplication of the JID/phone-number fact from the schema is the only redundant element.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Reads a chat's latest messages, newest first') and immediately scopes it with the 90-day window and newest-first ordering, which implicitly separates it from keyword-oriented siblings like search_messages. It also names its role in a workflow chain (JIDs come from get_recent_chats/search_contacts; media, transcripts, and polls route to download_media, transcribe_voice_note, get_poll_results).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Guidance is unusually concrete: it explains exactly how to page backwards ('pass the `before` the headline gives'), how to quote a message ('pass its `id` as `quote_id`... in groups, also its `sender_jid` as `quote_participant`'), and when to hand off to transcribe_voice_note, get_poll_results, or download_media. The only gap is that it never states when NOT to use this tool — notably no explicit contrast with search_messages for targeted lookups rather than recent-history reading.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.