Skip to main content
Glama

waha_get_group_invite_code

Retrieve WhatsApp group invite codes to share access with participants. Provide the group ID to generate a reusable invitation link for group management.

Instructions

Get group invite link.

Input Schema

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

Implementation Reference

  • Main MCP tool handler that validates input, calls the WAHA client, and formats the response with the invite code.
    private async handleGetGroupInviteCode(args: any) {
      const groupId = args.groupId;
    
      if (!groupId) {
        throw new Error("groupId is required");
      }
    
      const result = await this.wahaClient.getGroupInviteCode(groupId);
    
      return {
        content: [
          {
            type: "text",
            text: `Group ${groupId} invite link:\n${result.inviteCode}`,
          },
        ],
      };
    }
  • WAHA API client method that performs the HTTP GET request to retrieve the group invite code.
    async getGroupInviteCode(groupId: string): Promise<{ inviteCode: string }> {
      if (!groupId) {
        throw new WAHAError("groupId is required");
      }
    
      const endpoint = `/api/${this.session}/groups/${encodeURIComponent(groupId)}/invite-code`;
    
      return this.request<{ inviteCode: string }>(endpoint, {
        method: "GET",
      });
    }
  • Tool schema definition including name, description, and input schema requiring groupId.
    name: "waha_get_group_invite_code",
    description: "Get group invite link.",
    inputSchema: {
      type: "object",
      properties: {
        groupId: {
          type: "string",
          description: "Group ID (format: number@g.us)",
        },
      },
      required: ["groupId"],
    },
  • src/index.ts:1119-1120 (registration)
    Tool registration in the MCP CallToolRequestSchema switch statement dispatching to the handler.
    case "waha_get_group_invite_code":
      return await this.handleGetGroupInviteCode(args);
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. While 'Get' implies a read-only operation, the description doesn't specify whether this requires admin permissions, whether the invite code is reusable or time-limited, what format the link returns in, or if there are any rate limits. For a tool with zero annotation coverage, 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 at just three words ('Get group invite link'), with zero wasted language. It's front-loaded with the core action and resource, making it immediately understandable despite its brevity. Every word earns its place in this minimal description.

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 tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what format the invite link returns in (URL, code, expiration details), whether special permissions are needed, or how this differs from related group tools. Given the complexity of group management operations and the lack of structured documentation elsewhere, the description should provide more contextual information.

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?

The input schema has 100% description coverage, with the single parameter 'groupId' clearly documented as 'Group ID (format: number@g.us)'. The description doesn't add any additional parameter information beyond what the schema provides, which is acceptable given the high schema coverage. The baseline score of 3 reflects adequate parameter documentation through the schema alone.

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

Purpose3/5

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

The description 'Get group invite link' clearly states the verb ('Get') and resource ('group invite link'), making the purpose understandable. However, it doesn't distinguish this tool from sibling tools like 'waha_revoke_group_invite_code' or 'waha_get_group_info', which could cause confusion about when to use this specific tool versus alternatives.

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?

The description provides no guidance on when to use this tool versus alternatives. With sibling tools like 'waha_revoke_group_invite_code' (which likely removes invite codes) and 'waha_get_group_info' (which might include invite information), there's no indication of when this specific 'get' operation is appropriate versus other group-related tools.

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