download_media
Download and decrypt media from a WhatsApp message. Saves the file locally and returns the path. For images and audio under 5 MiB, also returns the content inline for viewing or playback.
Instructions
Fetch the encrypted media payload (image, video, audio, document) for a previously-cached message, decrypt it, and write it to a local file under the store directory; returns the absolute path. For image and audio downloads at most 5 MiB, the decrypted bytes are ALSO embedded in the tool result as an ImageContent or AudioContent block so remote MCP clients can view or hear the payload without accessing the daemon's filesystem. Videos and documents are not embedded (too large or not renderable inline). Optionally also writes the decrypted file to output_path, which must live under the configured media root (WHATSAPP_MCP_MEDIA_ROOT, default <store>/uploads/). No notification is sent to the sender or chat. Idempotent — repeated calls for the same message return the cached file path. Prerequisite: the message must contain media; use list_messages to find media message IDs. Returns a JSON object {Success, Message, MediaType, Filename, Path} as the first content block, followed by an optional ImageContent/AudioContent block for renderable media.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chat_jid | Yes | WhatsApp JID: individual as `<digits>@s.whatsapp.net` or bare phone digits, group as `<digits>-<timestamp>@g.us` | |
| message_id | Yes | WhatsApp message ID of a media message (use `message_id` from list_messages) | |
| output_path | No | optional absolute path under the configured media root (`WHATSAPP_MCP_MEDIA_ROOT`, default `<store>/uploads/`); parent directory must exist; calls are skipped if the file already exists; omit to write only to the daemon cache |