Skip to main content

Overview

Messaging tools allow AI agents to send various types of content to WhatsApp contacts and groups. All messaging tools support forwarding and reply features.
Before using messaging tools, ensure you are authenticated and connected to WhatsApp.

whatsapp_send_text

Send a text message to a WhatsApp contact or group. Supports ghost mentions (mention users without showing @phone in message text).

Parameters

ParameterTypeRequiredDescription
phonestringYesPhone number or group ID (e.g., 628123456789 or [email protected])
messagestringYesThe text message to send
is_forwardedbooleanNoWhether this message is being forwarded (default: false)
reply_message_idstringNoMessage ID to reply to (optional)
mentionsarrayNoPhone numbers or JIDs to mention (ghost mentions). Use "@everyone" to mention all group participants

Ghost Mentions

Ghost mentions allow you to notify users without showing @phone in the message text:
{
  "phone": "[email protected]",
  "message": "Hello everyone, please read this announcement",
  "mentions": ["628123456789", "628987654321"]
}
The message displays normally, but the specified users receive a mention notification.

Mention Everyone

Use the special keyword @everyone to mention all group participants:
{
  "phone": "[email protected]",
  "message": "Important: Meeting at 3 PM",
  "mentions": ["@everyone"]
}

Returns

{
  "message_id": "3EB0C767E8D4B2A9E4C3"
}
Fallback text: "Message sent successfully with ID 3EB0C767E8D4B2A9E4C3"

Example Usage

Send a WhatsApp message to 628123456789 saying "Hello from AI!"

Implementation Reference

Source: src/ui/mcp/send.go:33-109

whatsapp_send_contact

Send a contact card to a WhatsApp contact or group.

Parameters

ParameterTypeRequiredDescription
phonestringYesRecipient phone number or group ID
contact_namestringYesName of the contact to send
contact_phonestringYesPhone number of the contact to send
is_forwardedbooleanNoWhether this is a forwarded contact (default: false)

Returns

{
  "message_id": "3EB0C767E8D4B2A9E4C4"
}
Fallback text: "Contact sent successfully with ID 3EB0C767E8D4B2A9E4C4"

Example Usage

Send contact card for "John Doe" (+1234567890) to 628123456789

Implementation Reference

Source: src/ui/mcp/send.go:111-174 Send a link with caption to a WhatsApp contact or group.

Parameters

ParameterTypeRequiredDescription
phonestringYesRecipient phone number or group ID
linkstringYesURL link to send
captionstringYesCaption or description for the link
is_forwardedbooleanNoWhether this is a forwarded link (default: false)

Returns

{
  "message_id": "3EB0C767E8D4B2A9E4C5"
}
Fallback text: "Link sent successfully with ID 3EB0C767E8D4B2A9E4C5"

Example Usage

Send link https://example.com to 628123456789 with caption "Check this out!"

Implementation Reference

Source: src/ui/mcp/send.go:176-239

whatsapp_send_location

Send location coordinates to a WhatsApp contact or group.

Parameters

ParameterTypeRequiredDescription
phonestringYesRecipient phone number or group ID
latitudestringYesLatitude coordinate (as string, e.g., "-6.200000")
longitudestringYesLongitude coordinate (as string, e.g., "106.816666")
is_forwardedbooleanNoWhether this is a forwarded location (default: false)

Returns

{
  "message_id": "3EB0C767E8D4B2A9E4C6"
}
Fallback text: "Location sent successfully with ID 3EB0C767E8D4B2A9E4C6"

Example Usage

Send location -6.200000, 106.816666 to 628123456789
Coordinates must be provided as strings, not numbers. This is a quirk of the underlying WhatsApp protocol implementation.

Implementation Reference

Source: src/ui/mcp/send.go:241-304

whatsapp_send_image

Send an image to a WhatsApp contact or group.

Parameters

ParameterTypeRequiredDescription
phonestringYesRecipient phone number or group ID
image_urlstringYesURL of the image to send (HTTPS recommended)
captionstringNoCaption or description for the image
view_oncebooleanNoWhether this image should be viewed only once (default: false)
compressbooleanNoWhether to compress the image (default: true)
is_forwardedbooleanNoWhether this is a forwarded image (default: false)

Image Compression

When compress: true (default):
  • Images are compressed to reduce file size
  • Quality is optimized for WhatsApp delivery
  • Faster upload and download for recipients
When compress: false:
  • Original image quality is preserved
  • Larger file size
  • May take longer to send/receive

View Once

When view_once: true:
  • Image is deleted from chat after recipient views it
  • Cannot be saved, forwarded, or screenshot (WhatsApp enforces this)
  • Useful for sensitive images

Returns

{
  "message_id": "3EB0C767E8D4B2A9E4C7"
}
Fallback text: "Image sent successfully with ID 3EB0C767E8D4B2A9E4C7"

Example Usage

Send image https://example.com/photo.jpg to 628123456789

Implementation Reference

Source: src/ui/mcp/send.go:306-389

whatsapp_send_sticker

Send a sticker to a WhatsApp contact or group. Images are automatically converted to WebP sticker format.

Parameters

ParameterTypeRequiredDescription
phonestringYesRecipient phone number or group ID
sticker_urlstringYesURL of the image to convert to sticker
is_forwardedbooleanNoWhether this is a forwarded sticker

Supported Image Formats

GOWA automatically converts the following formats to WebP stickers:
  • JPG / JPEG
  • PNG (transparency preserved)
  • WebP (static)
  • GIF (converted to static WebP)

Animated Stickers

Animated WebP stickers are supported but must meet WhatsApp’s requirements:
  • Exactly 512x512 pixels
  • Under 500KB file size
  • Maximum 10 seconds duration
If your animated sticker doesn’t meet these requirements, WhatsApp will reject it. Use a tool like ezgif.com to resize before sending.

Returns

{
  "message_id": "3EB0C767E8D4B2A9E4C8"
}
Fallback text: "Sticker sent successfully with ID 3EB0C767E8D4B2A9E4C8"

Example Usage

Send sticker from https://example.com/image.png to 628123456789

Conversion Process

  1. Download image from sticker_url
  2. Resize to 512x512 pixels
  3. Convert to WebP format
  4. Send as WhatsApp sticker

Implementation Reference

Source: src/ui/mcp/send.go:391-444

Common Parameters

Phone Number Format

All messaging tools accept phone parameter in these formats:
FormatExampleDescription
Raw number628123456789Preferred for individual chats
JID[email protected]WhatsApp JID format
Group JID[email protected]Group chat identifier
You don’t need to include the @s.whatsapp.net suffix for individual numbers. GOWA will add it automatically.

Forward Flag

All messaging tools support the is_forwarded boolean:
{
  "is_forwarded": true
}
When true, the message displays with a “Forwarded” label in WhatsApp.

Error Handling

Common Errors

ErrorCauseSolution
phone must be a stringMissing or invalid phone parameterProvide valid phone number
message must be a stringMissing or invalid message parameterProvide message text
not logged inWhatsApp session not authenticatedLogin using whatsapp_login_qr
recipient not foundInvalid phone number or group IDVerify the phone number exists
media download failedInvalid URL or network errorCheck URL is accessible

Best Practices

  1. Check connection first: Call whatsapp_connection_status before sending messages
  2. Validate phone numbers: Ensure phone numbers are in correct format
  3. Use ghost mentions: For group notifications, use mentions array instead of @phone in text
  4. Compress large images: Enable compression for faster delivery
  5. Handle errors gracefully: Implement retry logic for network failures
  6. Respect rate limits: WhatsApp may rate-limit excessive messaging

Rate Limiting

WhatsApp enforces rate limits on message sending:
  • Individual chats: ~20 messages per minute
  • Group chats: ~10 messages per minute
  • Media: Slower rate limits apply
Exceeding these limits may result in temporary bans. Implement delays between messages for bulk operations.

Next Steps

Contacts & Chats

Query contacts, list chats, and download media

Group Management

Create and manage WhatsApp groups

Build docs developers (and LLMs) love