Skip to main content
Glama

waha_revoke_group_invite_code

Revoke and regenerate WhatsApp group invite codes to control access. This tool requires admin privileges to manage group security by invalidating old links and creating new ones.

Instructions

Revoke current invite link and generate a new one. Requires admin privileges.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
groupIdYesGroup ID (format: number@g.us)

Implementation Reference

  • src/index.ts:785-797 (registration)
    Registration of the 'waha_revoke_group_invite_code' tool in the ListTools response, including schema definition.
      name: "waha_revoke_group_invite_code",
      description: "Revoke current invite link and generate a new one. Requires admin privileges.",
      inputSchema: {
        type: "object",
        properties: {
          groupId: {
            type: "string",
            description: "Group ID (format: number@g.us)",
          },
        },
        required: ["groupId"],
      },
    },
  • The main handler function for the 'waha_revoke_group_invite_code' MCP tool. Validates input, calls the WAHA client, and formats the response with the new invite code.
    private async handleRevokeGroupInviteCode(args: any) {
      const groupId = args.groupId;
    
      if (!groupId) {
        throw new Error("groupId is required");
      }
    
      const result = await this.wahaClient.revokeGroupInviteCode(groupId);
    
      return {
        content: [
          {
            type: "text",
            text: `Successfully revoked previous invite code for group ${groupId}.\nNew invite link:\n${result.inviteCode}`,
          },
        ],
      };
  • WAHAClient method that makes the HTTP POST request to revoke the group invite code and retrieve the new one.
    async revokeGroupInviteCode(groupId: string): Promise<{ inviteCode: string }> {
      if (!groupId) {
        throw new WAHAError("groupId is required");
      }
    
      const endpoint = `/api/${this.session}/groups/${encodeURIComponent(groupId)}/invite-code/revoke`;
    
      return this.request<{ inviteCode: string }>(endpoint, {
        method: "POST",
      });
    }
  • src/index.ts:1122-1124 (registration)
    Tool dispatch/registration in the CallToolRequestSchema switch statement.
      return await this.handleRevokeGroupInviteCode(args);
    case "waha_join_group":
      return await this.handleJoinGroup(args);
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses the admin privilege requirement, which is crucial behavioral context. However, it doesn't mention other traits like whether the old link becomes invalid immediately, if there are rate limits, or what the output looks like (no output schema). It adds some value but misses key details.

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?

Two concise sentences with zero waste: the first states the action, the second adds critical context (admin requirement). It's front-loaded with the core purpose, and every word earns its place.

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?

Given no annotations and no output schema, the description is incomplete for a mutation tool. It covers the admin requirement but lacks details on behavioral outcomes (e.g., what happens to the old link, response format). For a tool that modifies group access, more context is needed to be fully helpful.

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 documents the 'groupId' parameter fully. The description doesn't add any meaning beyond what's in the schema (e.g., it doesn't explain format constraints or examples). Baseline 3 is appropriate as the schema does the heavy lifting.

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 clearly states the action ('Revoke current invite link and generate a new one') and the resource ('invite link'), distinguishing it from siblings like 'waha_get_group_invite_code' (which retrieves) and 'waha_get_group_join_info' (which checks). It uses specific verbs ('revoke', 'generate') rather than vague terms.

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

Usage Guidelines4/5

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

It provides explicit context for when to use this tool ('Requires admin privileges'), indicating it's for group administrators. However, it doesn't specify when not to use it or name alternatives (e.g., vs. 'waha_get_group_invite_code' for viewing), leaving some ambiguity.

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