send_message
Sends a WhatsApp message to one person or group: text, or a file (photo, document/PDF, voice note, audio file or sticker) with optional text as its caption. On the free plan, text works only to people who have written to the user (starting new conversations needs the paid plan), and "Sent via wa-mcp.com" is added at the end of it; files (media) need the paid plan. to can be a contact name, a phone number with country code, or a JID (…@s.whatsapp.net, …@lid, …@g.us); if a name could match more than one contact, call search_contacts first. To reply to a specific message (a quoted reply), pass its id from read_chat_history or search_messages as quote_id. To send a file, pass media with exactly one source: media.url, a link to the file; media.message_id, the id of a photo, video, voice note, audio, document or sticker message from read_chat_history or search_messages, to send that file on to someone (e.g. "send Ana the photo Juan sent me"); or media.data, base64 for small files you generated yourself (up to 512 KB). You can't pass on a file the user attached to this conversation: ask them to upload it to Google Drive, click Share, set access to "Anyone with the link", and paste the link here; pass that link unchanged as media.url. Google Drive file links, and Google Docs (sent as PDF), Sheets (XLSX) and Slides (PDF) links work directly; so does any public direct link to a file. Don't upload the user's files to other sites without asking them. The type is detected from the file: JPEG/PNG/WebP/GIF go as photos, MP4 (H.264) as a video, OGG/Opus audio as a voice note, other audio (MP3, M4A) as an audio file, everything else (PDF, Office files, other videos such as iPhone MOV/HEVC, HEIC) as a document. A file sent on with media.message_id keeps its kind (a voice note stays a voice note, a document keeps its name) and isn't marked as forwarded; its original caption isn't copied, so pass text for one. Limits: photos, videos and audio 16 MB, documents 32 MB. If you are writing the text yourself rather than sending words the user gave you, call get_writing_style for this chat first and write it the way the user writes; skip that for dictated text. WhatsApp doesn't render Markdown: use bold, italic, strikethrough and "- " lists, and never send tables, # headings, double asterisks or text links. Write a table as short lines (e.g. "Ana: $200") and paste URLs plain. Only format when it suits the message. To tag (mention) someone in a group so they get notified, write @ followed by their full phone number with country code, digits only (e.g. "@5215512345678", not "@Ana" or "@+52 55…"); WhatsApp shows their name in its place. Get the number from phone_display (read_chat_history participants or search_contacts). Never use the digits of a lid_jid. Messages that start new conversations have extra protection against WhatsApp's anti-spam bans and may be delayed or refused; the result says so and when. Sending the same text, especially with a link, to many people who haven't written to the user can get their number temporarily or permanently banned, even when spaced out: write each person their own message (not just a name swap), and warn the user about this risk when they ask for outreach. Sending can't be undone: confirm the recipient, text and file with the user first unless they already gave them. Messages are sent at a safe pace to protect the user's number; when several go at once, some may be queued and sent automatically. Returns { to, status (sent, failed, or queued), recipient, message_id, media?, text_message_id?, note?, error?, scheduled_id?, send_at?, position? }: recipient is who the message went to, with the contact fields (name; name_source: address_book, push_name, group_subject, business, phone or unresolved; canonical_jid: the JID to pass to send_message and read_chat_history; phone_jid and lid_jid: the chat's phone-number and LID forms, null when unknown or for groups; phone_display: the number as +). queued means it wasn't sent yet but goes out by itself at about send_at (number position in line; scheduled_id finds it in list_scheduled_messages and cancels it with cancel_scheduled_message), so don't send it again. message_id can be used as quote_id later. With media, media says how the file was sent ({ sent_as, mimetype, size_bytes, file_name? }) and note explains a fallback (e.g. a HEVC video sent as a document); tell the user. If WhatsApp rejects the send, the result is an error that still includes recipient and error.
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": {
"to": "<to>"
},
"name": "send_message"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | Contact name, phone number with country code, chat JID (person or group), or a group's exact name (case, accents, spaces and punctuation ignored; part of a group name doesn't match). | |
| text | No | The message text. With media, the caption of a photo or document (for audio and stickers, it is sent as a separate message just before the file). Required unless media is given. | |
| media | No | Optional. A file to send. Pass exactly one of url, message_id or data. | |
| quote_id | No | Optional. The `id` of the message to reply to (from read_chat_history or search_messages). | |
| quote_participant | No | Optional. The quoted message's `sender_jid` (from read_chat_history). Usually looked up automatically from quote_id; pass it if a group reply asks for it. |