Skip to main content
Glama
mcp-whatsapp

mcp-whatsapp

list_messages

Read-onlyIdempotent

Search and page through cached WhatsApp messages by chat, sender, time range, or text substring, with optional surrounding context. Read-only and works offline from the local cache.

Instructions

(reads local cache; works while disconnected) Search and page through cached WhatsApp messages, optionally filtering by chat, sender, time range, and substring; can include surrounding context messages. Read-only; no side effects. Use get_message_context to expand around a single known message ID, or request_sync to backfill missing history. Returns a human-readable formatted text block listing matching messages; edited messages show an [edited] marker and messages deleted for everyone keep their text behind a [deleted <time> UTC] marker.

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": "list_messages"
  }
}

Input Schema

NameRequiredDescriptionDefault
pageNozero-based page index for paging through results (default 0)
afterNoISO-8601 UTC lower bound on message timestamp (inclusive)
limitNomax messages to return (default 20, capped at 100 server-side)
queryNocase-insensitive substring to match within message body (text, or the caption of an image, video or document; edited messages match their latest text; messages deleted for everyone still match)
beforeNoISO-8601 UTC upper bound on message timestamp (inclusive)
chat_jidNofilter to messages in this chat (WhatsApp JID: individual as `<digits>@s.whatsapp.net` or bare phone digits, group as `<digits>-<timestamp>@g.us`)
context_afterNomessages to include after each match (default 1, capped at 20 server-side)
context_beforeNomessages to include before each match (default 1, capped at 20 server-side)
include_contextNoif true, attach a few surrounding messages to each match (defaults to true)
sender_phone_numberNofilter to messages sent by this phone or JID (WhatsApp JID: individual as `<digits>@s.whatsapp.net` or bare phone digits, group as `<digits>-<timestamp>@g.us`)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.7.2
    • changedInput schema / properties / query / description
      Previous value: -"case-insensitive substring to match within message body"New value: +"case-insensitive substring to match within message body (text, or the caption of an image, video or document; edited messages match their latest text; messages deleted for everyone still match)"
  2. Changed10 schema fields changedv0.3.0
    • changedInput schema / properties / after / description
      Previous value: -"ISO-8601 lower bound"New value: +"ISO-8601 UTC lower bound on message timestamp (inclusive)"
    • changedInput schema / properties / before / description
      Previous value: -"ISO-8601 upper bound"New value: +"ISO-8601 UTC upper bound on message timestamp (inclusive)"
    • changedInput schema / properties / chat_jid / description
      Previous value: -"WhatsApp JID: individual as `<digits>@s.whatsapp.net` or bare phone digits, group as `<digits>-<timestamp>@g.us`"New value: +"filter to messages in this chat (WhatsApp JID: individual as `<digits>@s.whatsapp.net` or bare phone digits, group as `<digits>-<timestamp>@g.us`)"
    • addedInput schema / properties / context_after / description
      Added value: +"messages to include after each match (default 1, capped at 20 server-side)"
    • addedInput schema / properties / context_before / description
      Added value: +"messages to include before each match (default 1, capped at 20 server-side)"
    • addedInput schema / properties / include_context / description
      Added value: +"if true, attach a few surrounding messages to each match (defaults to true)"
    • addedInput schema / properties / limit / description
      Added value: +"max messages to return (default 20, capped at 100 server-side)"
    • addedInput schema / properties / page / description
      Added value: +"zero-based page index for paging through results (default 0)"
    • changedInput schema / properties / query / description
      Previous value: -"case-insensitive substring to match"New value: +"case-insensitive substring to match within message body"
    • changedInput schema / properties / sender_phone_number / description
      Previous value: -"WhatsApp JID: individual as `<digits>@s.whatsapp.net` or bare phone digits, group as `<digits>-<timestamp>@g.us`"New value: +"filter to messages sent by this phone or JID (WhatsApp JID: individual as `<digits>@s.whatsapp.net` or bare phone digits, group as `<digits>-<timestamp>@g.us`)"
  3. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Beyond the annotations (readOnly/idempotent/non-destructive/openWorld=false), the description adds genuinely non-obvious behavior: results come from a local cache that functions offline, output is a human-readable formatted text block, edited messages carry an [edited] marker, and deleted messages retain their text behind a [deleted <time> UTC] marker. One behavioral detail is left unstated: whether surrounding context messages count against the limit/page size, which affects how callers read pagination.

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?

Front-loads the most important constraint (reads local cache; works while disconnected) before the purpose statement, and packs alternatives and return-format notes efficiently. The deleted-marker clause is slightly dense but carries real information about how deletions are surfaced.

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

Completeness4/5

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

With 10 optional parameters and no output schema, the description does the needed work: it describes return shape, marker conventions, and points at the sibling for cache gaps. The only shortfall is the unaddressed interaction between context_before/context_after and limit/paging, which an agent must infer.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents every parameter including JID formats, ISO-8601 bounds, and server-side caps. The description names the filter categories (chat, sender, time range, substring) and context inclusion but adds no format or edge-case semantics beyond what the schema provides, so baseline 3 is appropriate.

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+resource ('Search and page through cached WhatsApp messages') and enumerates the filter dimensions and the optional context attachment. It also distinguishes itself from siblings by noting it works on local cached data, which no other tool claims.

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

Usage Guidelines5/5

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

Explicitly routes the agent to two named alternatives with their triggering conditions: get_message_context when a single known message ID needs expanding, and request_sync when history is missing. The parenthetical '(reads local cache; works while disconnected)' further frames when this tool is the right pick.

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