Skip to main content
Glama
ExoCubeYT

OpenWA MCP Server

by ExoCubeYT

remove_group_member

Remove a participant from a WhatsApp group by providing the session ID, group ID, and the participant's phone ID.

Instructions

Remove a participant from a WhatsApp group

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionIdYesSession ID
groupIdYesGroup ID
participantIdYesPhone ID of the participant to remove

Implementation Reference

  • Registration of the 'remove_group_member' tool with its name, description, input schema, and handler logic. Calls openwaClient with DELETE method on the members endpoint.
    server.registerTool(
      "remove_group_member",
      {
        description: "Remove a participant from a WhatsApp group",
        inputSchema: {
          sessionId: z.string().describe("Session ID"),
          groupId: z.string().describe("Group ID"),
          participantId: z.string().describe("Phone ID of the participant to remove"),
        },
      },
      async ({ sessionId, groupId, participantId }) => {
        const data = await openwaClient({
          method: "DELETE",
          path: `/sessions/${sessionId}/groups/${groupId}/members/${participantId}`,
        });
        return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
      }
    );
  • Input schema defining sessionId (string), groupId (string), and participantId (string) as required parameters.
    "remove_group_member",
    {
      description: "Remove a participant from a WhatsApp group",
      inputSchema: {
        sessionId: z.string().describe("Session ID"),
        groupId: z.string().describe("Group ID"),
        participantId: z.string().describe("Phone ID of the participant to remove"),
      },
    },
  • Handler function that executes the tool logic: sends a DELETE request to `/sessions/{sessionId}/groups/{groupId}/members/{participantId}` via openwaClient.
    async ({ sessionId, groupId, participantId }) => {
      const data = await openwaClient({
        method: "DELETE",
        path: `/sessions/${sessionId}/groups/${groupId}/members/${participantId}`,
      });
      return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
    }
  • src/index.ts:18-18 (registration)
    Registration entry point: calls registerGroupTools(server) which registers remove_group_member.
    registerGroupTools(server);
  • The openwaClient helper function used by the handler to make HTTP requests to the OpenWA API.
    export async function openwaClient<T = unknown>(opts: RequestOptions): Promise<T> {
      const url = `${BASE_URL}${opts.path}`;
    
      const headers: Record<string, string> = {
        "Content-Type": "application/json",
        "X-API-Key": API_KEY,
      };
    
      const res = await fetch(url, {
        method: opts.method,
        headers,
        body: opts.body ? JSON.stringify(opts.body) : undefined,
      });
    
      const text = await res.text();
    
      if (!res.ok) {
        throw new Error(`OpenWA API ${res.status}: ${text}`);
      }
    
      try {
        return JSON.parse(text) as T;
      } catch {
        return text as T;
      }
    }
Behavior2/5

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

No annotations are provided, so the description must carry the behavioral transparency burden. It fails to disclose if removal is permanent, requires admin privileges, or has side effects like triggering notifications.

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?

A single sentence with no wasted words, front-loaded with the action and resource. Appropriate length.

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

Completeness3/5

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

For a simple tool with 3 required params and no output schema, the description covers the basic purpose but lacks context about prerequisites (e.g., must be admin) or consequences (e.g., cannot remove last admin). Adequate but not thorough.

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 coverage is 100% with terse but clear descriptions. The tool description does not add additional meaning beyond the schema, so baseline of 3 applies.

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

Purpose5/5

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

The description 'Remove a participant from a WhatsApp group' clearly states the verb (remove) and the resource (participant from a WhatsApp group), distinguishing it from siblings like add_group_member and leave_group.

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

Usage Guidelines2/5

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

No guidance on when to use this tool vs alternatives (e.g., leave_group, demote_member). No prerequisites or context about admin rights are mentioned.

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/ExoCubeYT/openwa-mcp'

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