Skip to main content
Glama
Sealjay

mcp-whatsapp

by Sealjay

request_sync

Idempotent

Backfill historical WhatsApp chat messages into the local cache so they can be queried later, extending older history or filling recent gaps without affecting the chat or other users.

Instructions

Ask WhatsApp servers to backfill historical messages for a chat into the local cache; messages arrive asynchronously and become queryable via list_messages once delivered. No effect on the chat itself or other users. The request is always anchored on a real cached message, because WhatsApp resolves the cursor by message key. Use anchor: "oldest" to extend history backwards, calling repeatedly to walk back count messages at a time; anchor: "newest" (the default) only fills gaps below the most recent message. Returns a plain-text confirmation describing what was requested. An empty result afterwards means the server served nothing for that cursor, typically because the history predates WhatsApp's retention for linked devices.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
countNohow many messages to request before the anchor (default 50)
anchorNowhich cached message to anchor on: `oldest` to extend history backwards, `newest` to fill recent gaps (default)
use_lidNoresolve the chat to its LID form (default true). Messages predating WhatsApp's LID migration are keyed on the phone-number JID; set false when walking back past that boundary returns empty batches
chat_jidYesWhatsApp JID: individual as `<digits>@s.whatsapp.net` or bare phone digits, group as `<digits>-<timestamp>@g.us`
from_timestampNoISO-8601 UTC timestamp; anchors on the newest cached message at or before this time, falling back to the oldest cached message when nothing is cached that far back. Ignored when `anchor` is set

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv0.6.0
    • addedInput schema / properties / anchor
      Added value: +{
      +  "description": "which cached message to anchor on: `oldest` to extend history backwards, `newest` to fill recent gaps (default)",
      +  "enum": [
      +    "newest",
      +    "oldest"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / count
      Added value: +{
      +  "default": 50,
      +  "description": "how many messages to request before the anchor (default 50)",
      +  "type": "number"
      +}
    • changedInput schema / properties / from_timestamp / description
      Previous value: -"ISO-8601 UTC timestamp marking the lower bound; if omitted, anchors on the newest cached message in the chat"New value: +"ISO-8601 UTC timestamp; anchors on the newest cached message at or before this time, falling back to the oldest cached message when nothing is cached that far back. Ignored when `anchor` is set"
    • addedInput schema / properties / use_lid
      Added value: +{
      +  "default": true,
      +  "description": "resolve the chat to its LID form (default true). Messages predating WhatsApp's LID migration are keyed on the phone-number JID; set false when walking back past that boundary returns empty batches",
      +  "type": "boolean"
      +}
    • changedInput schema / required
      Previous value: -[]New value: +[
      +  "chat_jid"
      +]
  2. Changed1 schema field changedv0.3.0
    • changedInput schema / properties / from_timestamp / description
      Previous value: -"ISO-8601 UTC timestamp"New value: +"ISO-8601 UTC timestamp marking the lower bound; if omitted, anchors on the newest cached message in the chat"
  3. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations (readOnlyHint=false, openWorldHint=true, idempotentHint=true) establish the request profile, and the description adds non-obvious behavior: async delivery, no effect on the chat or other users, anchoring on a real cached message, and empty-batch diagnostics due to WhatsApp retention limits. No contradiction with annotations.

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-loaded with purpose and the async caveat, and every sentence carries information (scope, anchoring, return, failure mode). It is long and has mild overlap with the schema's anchor text, but no sentence is filler.

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?

For a 5-param, no-output-schema tool this covers everything an agent needs: what it triggers, how it anchors, how to iterate, the migration edge case, the plain-text return, and the empty-result failure mode. Nothing material is missing.

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

Parameters5/5

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

Although schema coverage is 100%, the description adds meaning the schema lacks: the anchor-walking cadence ('calling repeatedly to walk back count messages'), the newest-as-default gap-fill semantics, and the LID-vs-phone-JID boundary that explains when to pass use_lid=false and when from_timestamp is ignored. This goes well beyond restating field descriptions.

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 ('Ask WhatsApp servers to backfill historical messages for a chat into the local cache') and immediately distinguishes itself from the sibling list_messages by noting those messages only 'become queryable via list_messages once delivered.' An agent can tell exactly what this tool does versus reading cached messages.

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?

Explicit routing guidance: use anchor: 'oldest' to extend history backwards and call repeatedly to walk back count at a time, anchor: 'newest' (default) to fill recent gaps, set use_lid false when passing the LID migration boundary. It also explains what an empty result means and why. This is unusually complete when-to-use coverage.

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