Skip to main content

Overview

Group management tools provide comprehensive control over WhatsApp groups. Create groups, manage members, configure settings, and handle join requests programmatically through MCP.

whatsapp_group_create

Create a new WhatsApp group with an optional participant list.

Parameters

ParameterTypeRequiredDescription
titlestringYesGroup subject/title
participantsarrayNoPhone numbers to add during creation (without @s.whatsapp.net suffix)

Returns

{
  "group_id": "[email protected]",
  "title": "Project Team",
  "members": 3
}
Fallback text: "Created group [email protected] with 3 members"

Example Usage

Create a WhatsApp group named "Project Team"

Hints

  • Read-only: false
  • Destructive: true (creates new group)
  • Idempotent: false (creates new group each time)

Implementation Reference

Source: src/ui/mcp/group.go:40-96 Join a group using an invite link.

Parameters

ParameterTypeRequiredDescription
invite_linkstringYesWhatsApp group invite link
Accepted formats:
  • https://chat.whatsapp.com/ABC123xyz
  • chat.whatsapp.com/ABC123xyz
  • ABC123xyz (just the code)

Returns

{
  "group_id": "[email protected]",
  "invite_link": "https://chat.whatsapp.com/ABC123xyz"
}
Fallback text: "Joined group [email protected]"

Example Usage

Join WhatsApp group using link https://chat.whatsapp.com/ABC123xyz

Hints

  • Read-only: false
  • Destructive: true (joins group)
  • Idempotent: false

Implementation Reference

Source: src/ui/mcp/group.go:98-136

whatsapp_group_leave

Leave a WhatsApp group by its ID.

Parameters

ParameterTypeRequiredDescription
group_idstringYesGroup JID or numeric ID

Returns

Left group [email protected]

Example Usage

Leave WhatsApp group [email protected]
Leaving a group is permanent. You must be re-invited to rejoin.

Hints

  • Read-only: false
  • Destructive: true
  • Idempotent: false

Implementation Reference

Source: src/ui/mcp/group.go:138-172

whatsapp_group_participants

Retrieve the participant list for a group.

Parameters

ParameterTypeRequiredDescription
group_idstringYesGroup JID or numeric ID

Returns

{
  "group_id": "[email protected]",
  "participants": [
    {
      "jid": "[email protected]",
      "is_admin": true,
      "is_super_admin": true
    },
    {
      "jid": "[email protected]",
      "is_admin": false,
      "is_super_admin": false
    }
  ]
}
Fallback text: "Group [email protected] has 2 participants"

Participant Roles

  • Super Admin: Creator of the group (cannot be demoted)
  • Admin: Can add/remove members, change settings
  • Member: Regular participant

Hints

  • Read-only: true
  • Destructive: false
  • Idempotent: true

Implementation Reference

Source: src/ui/mcp/group.go:174-210

whatsapp_group_manage_participants

Add, remove, promote, or demote group participants.

Parameters

ParameterTypeRequiredDescription
group_idstringYesGroup JID or numeric ID
participantsarrayYesPhone numbers of participants to modify (without suffix)
actionstringYesParticipant action: add, remove, promote, or demote

Actions

ActionDescriptionRequired Role
addAdd participants to groupAdmin
removeRemove participants from groupAdmin
promotePromote member to adminAdmin
demoteDemote admin to memberAdmin (cannot demote super admin)

Returns

{
  "success": true,
  "action": "add",
  "affected_count": 2
}
Fallback text: "Applied add to 2 participants in [email protected]"

Example Usage

Add 628123456789 and 628987654321 to group [email protected]

Hints

  • Read-only: false
  • Destructive: true
  • Idempotent: false

Implementation Reference

Source: src/ui/mcp/group.go:212-291 Fetch the invite link for a group, optionally resetting it.

Parameters

ParameterTypeRequiredDefaultDescription
group_idstringYes-Group JID or numeric ID
resetbooleanNofalseIf true, reset the invite link (invalidates old link)

Returns

{
  "invite_link": "https://chat.whatsapp.com/ABC123xyz"
}
Fallback text: "Invite link for [email protected]: https://chat.whatsapp.com/ABC123xyz"

Reset Behavior

When reset: true:
  • Old invite link is invalidated
  • New invite link is generated
  • Anyone with old link can no longer join

Example Usage

Hints

  • Read-only: false
  • Destructive: true (when reset=true)
  • Idempotent: false

Implementation Reference

Source: src/ui/mcp/group.go:293-347

whatsapp_group_info

Retrieve detailed WhatsApp group information.

Parameters

ParameterTypeRequiredDescription
group_idstringYesGroup JID or numeric ID

Returns

{
  "group_id": "[email protected]",
  "name": "Project Team",
  "topic": "Discuss project updates and deadlines",
  "owner": "[email protected]",
  "created_at": "2026-01-15T10:00:00Z",
  "participant_count": 15,
  "is_locked": false,
  "is_announce": false
}

Group Settings

  • is_locked: If true, only admins can edit group info
  • is_announce: If true, only admins can send messages

Hints

  • Read-only: true
  • Destructive: false
  • Idempotent: true

Implementation Reference

Source: src/ui/mcp/group.go:349-385

whatsapp_group_set_name

Update the group’s display name.

Parameters

ParameterTypeRequiredDescription
group_idstringYesGroup JID or numeric ID
namestringYesNew group name

Returns

Updated group [email protected] name to Team Alpha

Example Usage

Rename group [email protected] to "Team Alpha"

Hints

  • Read-only: false
  • Destructive: true
  • Idempotent: false

Implementation Reference

Source: src/ui/mcp/group.go:387-430

whatsapp_group_set_topic

Update the group’s topic or description.

Parameters

ParameterTypeRequiredDescription
group_idstringYesGroup JID or numeric ID
topicstringYesNew group topic/description

Returns

Updated group [email protected] topic

Example Usage

Set topic for group [email protected] to "Weekly standup meetings and updates"

Hints

  • Read-only: false
  • Destructive: true
  • Idempotent: false

Implementation Reference

Source: src/ui/mcp/group.go:432-475

whatsapp_group_set_locked

Toggle whether only admins can edit group info.

Parameters

ParameterTypeRequiredDescription
group_idstringYesGroup JID or numeric ID
lockedbooleanYesSet to true to lock the group

Locked State

When locked: true:
  • Only admins can change group name
  • Only admins can change group icon
  • Only admins can change group description
When locked: false:
  • All participants can edit group info

Returns

Group [email protected] is now locked

Example Usage

Lock group [email protected]

Hints

  • Read-only: false
  • Destructive: true
  • Idempotent: false

Implementation Reference

Source: src/ui/mcp/group.go:477-535

whatsapp_group_set_announce

Toggle announcement-only mode.

Parameters

ParameterTypeRequiredDescription
group_idstringYesGroup JID or numeric ID
announcebooleanYesSet to true to allow only admins to send messages

Announce Mode

When announce: true:
  • Only admins can send messages
  • Regular members can only read messages
  • Useful for broadcast/announcement groups
When announce: false:
  • All participants can send messages
  • Regular group chat behavior

Returns

Group [email protected] is now in announcement-only mode

Example Usage

Set group [email protected] to announcement-only mode

Hints

  • Read-only: false
  • Destructive: true
  • Idempotent: false

Implementation Reference

Source: src/ui/mcp/group.go:537-595

whatsapp_group_join_requests

List pending requests to join a group.

Parameters

ParameterTypeRequiredDescription
group_idstringYesGroup JID or numeric ID

Returns

[
  {
    "jid": "[email protected]",
    "requested_at": "2026-03-04T10:30:00Z"
  },
  {
    "jid": "[email protected]",
    "requested_at": "2026-03-04T11:15:00Z"
  }
]
Fallback text: "Group [email protected] has 2 pending requests"

When Join Requests Occur

Join requests happen when:
  • Group requires admin approval for new members
  • User clicks invite link but cannot auto-join

Hints

  • Read-only: true
  • Destructive: false
  • Idempotent: true

Implementation Reference

Source: src/ui/mcp/group.go:597-633

whatsapp_group_manage_join_requests

Approve or reject pending group join requests.

Parameters

ParameterTypeRequiredDescription
group_idstringYesGroup JID or numeric ID
participantsarrayYesPhone numbers of requesters (without suffix)
actionstringYesAction to apply: approve or reject

Returns

{
  "success": true,
  "action": "approve",
  "affected_count": 2
}
Fallback text: "Approved 2 pending requests for [email protected]"

Example Usage

Approve join requests for 628123456789 and 628987654321 in group [email protected]

Hints

  • Read-only: false
  • Destructive: true
  • Idempotent: false

Implementation Reference

Source: src/ui/mcp/group.go:635-726

Helper Functions

Participant Change Parser

func parseParticipantChange(action string) (whatsmeow.ParticipantChange, error) {
    switch strings.ToLower(strings.TrimSpace(action)) {
    case "add":     return whatsmeow.ParticipantChangeAdd, nil
    case "remove":  return whatsmeow.ParticipantChangeRemove, nil
    case "promote": return whatsmeow.ParticipantChangePromote, nil
    case "demote":  return whatsmeow.ParticipantChangeDemote, nil
    default:        return "", fmt.Errorf("invalid participant action: %s", action)
    }
}
Source: src/ui/mcp/group.go:728-741

Join Request Action Parser

func parseParticipantRequestChange(action string) (whatsmeow.ParticipantRequestChange, error) {
    switch strings.ToLower(strings.TrimSpace(action)) {
    case "approve": return whatsmeow.ParticipantChangeApprove, nil
    case "reject":  return whatsmeow.ParticipantChangeReject, nil
    default:        return "", fmt.Errorf("invalid join request action: %s", action)
    }
}
Source: src/ui/mcp/group.go:743-752

String Array Parser

func toStringSlice(raw any) ([]string, error) {
    // Handles []string, []any with string items
    // Trims whitespace from all items
}
Source: src/ui/mcp/group.go:754-779

Best Practices

  1. Check permissions: Verify you’re an admin before attempting admin-only actions
  2. Validate participants: Ensure phone numbers exist before adding to groups
  3. Handle errors gracefully: Some operations may fail due to WhatsApp restrictions
  4. Reset links carefully: Resetting invite links invalidates all existing links
  5. Test with small groups: Validate changes on test groups before production use

Common Errors

ErrorCauseSolution
not authorizedYou’re not an adminOnly admins can perform this action
participant not foundInvalid phone numberVerify the participant exists
group not foundInvalid group_idCheck the group JID is correct
cannot demote super adminAttempting to demote group creatorSuper admins cannot be demoted
invalid actionUnknown action stringUse add, remove, promote, or demote

Next Steps

Connection Tools

Manage WhatsApp authentication and connection

Messaging Tools

Send messages, images, and more

Build docs developers (and LLMs) love