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). 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 someone edited shows its latest text with edited: true; edits made with edit_message don't show yet (its text stays the original here). 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.

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?

Beyond the readOnly annotation, it discloses pagination behavior, the ~90-day history window, early page termination for long messages, media placeholders, and how edited messages are represented. These are substantive behavioral details an agent needs before calling the tool.

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 purpose and return shape are front-loaded, and most sentences carry unique operational detail. The description is dense and semicolon-heavy, but it avoids obvious filler and appropriately documents a tool with no output schema.

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?

There is no output schema, but the description fully explains the return object, participant mapping, contact fields, pagination, edits, quoting, and JID sources. An agent has enough information to call it correctly without additional documentation.

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 meaning beyond the schema: it explains that `limit` may stop early, that `before` should be the oldest shown message id, and how message ids are reused for quoting in send_message.

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?

The description states a specific verb and resource: "Reads a chat's latest messages, newest first", and immediately names the returned fields. It also distinguishes this from related tools by pointing to download_media for media files and to get_recent_chats/search_contacts for obtaining JIDs.

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?

It gives clear usage context: use `before` to page further back, pass a message `id` as `quote_id` to send_message, and fetch media via download_media. It does not explicitly say when to use this tool versus search_messages, so it lacks a full when/when-not routing statement.

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.

Resources