Skip to main content
Glama

import_chat_export

Idempotent

Import a WhatsApp "Export chat" file (.txt or .zip) to backfill history older than phone sync, skipping duplicates and already-synced messages. Run dry_run first to preview counts.

Instructions

Add the messages of a WhatsApp "Export chat" file to a chat, for history older than the phone sync.

path is a .txt file or a .zip (text plus media) inside downloads_dir, exports_dir or a folder in import.allowed_dirs. chat is a JID, a phone number or a chat name. me is the sender name that is you, as the export shows it; it is needed unless the file name or the account's push name tells. date_order is dmy, mdy or ymd and is detected when the file allows it. timezone is the zone the export was made in (default: local time). names maps a sender name to a JID or phone number.

Run it with dry_run=true first: it reports the counts, the detected date order and how each sender name would be stored, and writes nothing. The same file can be imported again without creating duplicates, and messages that the phone already synced are skipped. Nothing is sent to anyone. Needs the bridge to be running.

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": {
      "path": "<path>",
      "chat": "<chat>"
    },
    "name": "import_chat_export"
  }
}

Input Schema

NameRequiredDescriptionDefault
meNo
chatYes
pathYes
namesNo
accountNoAccount from list_accounts when several WhatsApp numbers are set up; default: default
dry_runNo
timezoneNo
date_orderNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the annotations: explains exactly what dry_run reports (counts, detected date order, sender-name mapping) and that it writes nothing, plus dedup behavior, skipping of already-synced messages, the guarantee that nothing is sent to anyone, and the prerequisite that the bridge must be running. This complements rather than repeats readOnlyHint=false / idempotentHint=true.

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?

Purpose is front-loaded in the first sentence, then parameters, then the safe-usage note. Every sentence carries information, though the parameter paragraph is a dense run of 'X is ...' clauses that could be tightened slightly.

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?

For an 8-parameter import with an output schema available, the description covers inputs, safety, idempotency, and the environment prerequisite. It stops short of failure modes such as an unparseable export, ambiguous date order that can't be detected, or an invalid path outside the allowed roots.

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?

With only 13% schema coverage, the description carries the load and does so well: path format and allowed roots, chat accepted as JID/phone/name, me says who the user is in the export and when it can be inferred, date_order enumerates dmy/mdy/ymd with detection, timezone defaults to local, and names maps sender names to JIDs. Only account is left to the schema's own description, and dry_run is covered behaviorally.

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?

Names a specific verb and resource: adding messages from a WhatsApp 'Export chat' file into a chat, explicitly scoped to 'history older than the phone sync', which distinguishes it from the live-sync siblings. An agent can identify the tool and its input format without opening the schema.

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?

Gives a concrete recommended workflow ('Run it with dry_run=true first') and states that re-importing the same file is safe and phone-synced messages are skipped. It implies the boundary with phone-sync tools but never names an alternative sibling such as sync_chat_history or request_chat_history, so the routing guidance is clear but not exhaustive.

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