Skip to main content
Glama
AIBE13
by AIBE13

backfill_history

Recover missed WhatsApp messages from chats that were active while the bridge was offline by requesting older message history from WhatsApp's sync, returning the number of messages added and per-chat request info.

Instructions

Try to recover WhatsApp messages missed while the bridge was offline (e.g. you didn't open Cowork for a few days, leaving a gap in the history). For each of the most recently active chats it asks WhatsApp's on-demand history sync (Baileys fetchMessageHistory) for older messages, anchored at the newest cached message in that chat. Results arrive asynchronously and are cached. IMPORTANT: how far back WhatsApp actually serves is decided by WhatsApp, not us - run this to find out empirically for this account. Returns cacheBefore/cacheAfter (messagesAdded) and per-chat request info. If messagesAdded is ~0, WhatsApp didn't serve more for those anchors; a fresh re-link (relink_whatsapp) is the fuller-history fallback.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chatsNoHow many recently-active chats to backfill.
countNoMessages to request per chat (older than that chat's newest cached message).
chatIdNoLimit to one chat (its raw JID). Overrides `chats`.
settleMsNoHow long to wait for async history to land before reporting messagesAdded.
Behavior5/5

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

Discloses async nature, caching, request anchoring, that WhatsApp controls how far back it serves, and return fields (cacheBefore/cacheAfter). No annotations provided, so description fully handles transparency.

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

Conciseness5/5

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

Concise paragraph with clear flow: purpose, mechanism, limitation, return info. Every sentence adds value.

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?

Given no output schema, description explains return values and what to do if results are poor. Covers async behavior, caching, and fallback sufficiently for an agent.

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 covers 100% of parameter descriptions, so baseline 3. Description does not add new parameter-level detail beyond context but reinforces usage context.

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?

Clearly states the tool recovers missed WhatsApp messages when the bridge was offline, with specific verb 'recover' and resource 'history'. Distinguishes from siblings like relink_whatsapp by positioning it as a fallback.

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 says when to use ('bridge was offline') and when not to expect full history (WhatsApp decides). Provides alternative (relink_whatsapp) if messagesAdded is ~0.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/AIBE13/whatsapp-local-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server