Send a file
send_filePreviews a file attachment for a WhatsApp recipient and delivers it only after the user approves that exact file and recipient, preventing accidental sends.
Instructions
Send a file (image, video, document, or an audio file as a plain attachment) with an optional caption. The file must be under the daemon's send root directory.
Safety: with confirm=false (the default) NOTHING is sent; the tool returns a preview. Show it to the user and call again with confirm=true only after they approved that exact file and recipient. Never set confirm=true on the first call.
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": {
"recipient": "<recipient>",
"media_path": "<media_path>"
},
"name": "send_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| caption | No | optional caption (images, videos, documents) | |
| confirm | No | false (default) only previews; true sends, after the user approved the preview | |
| recipient | Yes | phone number with country code (no +), a JID or a contact name | |
| media_path | Yes | absolute path of the file, under the send root directory |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sent | Yes | true only when the message left the account | |
| message | Yes | human-readable status | |
| preview | No | ||
| timestamp | No | server timestamp of the sent message | |
| message_id | No | ||
| needs_confirmation | Yes | true when this was a preview: repeat the call with confirm=true after the user approved |