Skip to main content
Glama

waha_remove_group_participants

Remove participants from a WhatsApp group. This tool requires admin privileges and uses group ID and participant data to manage group membership.

Instructions

Remove member(s) from a group. Requires admin privileges.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
groupIdYesGroup ID (format: number@g.us)
participantsYesJSON array of participants to remove (format: [{'id': 'number@c.us'}, ...])

Implementation Reference

  • MCP tool handler that validates input, parses JSON participants array, calls WAHAClient.removeGroupParticipants(), and returns formatted success response with result.
    private async handleRemoveGroupParticipants(args: any) {
      const groupId = args.groupId;
      const participantsStr = args.participants;
    
      if (!groupId) {
        throw new Error("groupId is required");
      }
    
      if (!participantsStr) {
        throw new Error("participants is required");
      }
    
      const participants = JSON.parse(participantsStr);
    
      const result = await this.wahaClient.removeGroupParticipants({
        groupId,
        participants,
      });
    
      return {
        content: [
          {
            type: "text",
            text: `Successfully removed ${participants.length} participant(s) from group ${groupId}.\n${JSON.stringify(result, null, 2)}`,
          },
        ],
      };
    }
  • Tool schema definition including input schema, properties for groupId and participants (as JSON string), and description.
      name: "waha_remove_group_participants",
      description: "Remove member(s) from a group. Requires admin privileges.",
      inputSchema: {
        type: "object",
        properties: {
          groupId: {
            type: "string",
            description: "Group ID (format: number@g.us)",
          },
          participants: {
            type: "string",
            description: "JSON array of participants to remove (format: [{'id': 'number@c.us'}, ...])",
          },
        },
        required: ["groupId", "participants"],
      },
    },
  • src/index.ts:1113-1114 (registration)
    Registration in the MCP CallToolRequestHandler switch statement dispatching to the specific handler.
    case "waha_remove_group_participants":
      return await this.handleRemoveGroupParticipants(args);
  • Underlying WAHAClient helper method that makes HTTP POST request to WAHA API endpoint to remove participants from group.
    async removeGroupParticipants(params: {
      groupId: string;
      participants: Array<{ id: string }>;
    }): Promise<any> {
      const { groupId, participants } = params;
    
      if (!groupId) {
        throw new WAHAError("groupId is required");
      }
    
      if (!participants || participants.length === 0) {
        throw new WAHAError("participants array is required");
      }
    
      const endpoint = `/api/${this.session}/groups/${encodeURIComponent(groupId)}/participants/remove`;
    
      const body = { participants };
    
      return this.request<any>(endpoint, {
        method: "POST",
        body: JSON.stringify(body),
      });
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the admin privilege requirement, which is valuable context. However, it doesn't describe what happens after removal (e.g., whether participants are notified, if removal is reversible, error conditions for invalid participants, or rate limits). For a destructive mutation tool, this leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise (two short sentences) and front-loaded with the core action. Every word serves a purpose: the first sentence states what the tool does, and the second adds critical context about permissions. There's no wasted verbiage or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive mutation tool with no annotations and no output schema, the description is incomplete. It lacks information about return values (e.g., success confirmation or error details), side effects, error handling, and how it differs from similar tools. The admin requirement is noted, but other critical behavioral aspects are missing, making it insufficient for safe and effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already fully documents both parameters (groupId and participants) with their formats. The description adds no additional parameter information beyond what's in the schema, such as examples of valid group IDs or participant arrays. This meets the baseline for high schema coverage but doesn't enhance understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Remove member(s) from a group') and identifies the resource ('group'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from its sibling 'waha_leave_group' (which removes the current user) or 'waha_demote_group_admin' (which changes permissions rather than removing participants), leaving some ambiguity about scope.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides one explicit usage guideline ('Requires admin privileges'), which is helpful for understanding prerequisites. However, it offers no guidance on when to use this tool versus alternatives like 'waha_leave_group' or 'waha_demote_group_admin', nor does it specify scenarios where removal is appropriate versus other actions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/seejux/waha-whatsapp-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server