Skip to main content
Glama
billyfranklim1

mcp-evolution

Revoke Invite Code

revoke_invite_code

Revoke the current invite code of a WhatsApp group and generate a new one through the pinned instance.

Instructions

Revoke and regenerate the invite code for a WhatsApp group via the pinned instance.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
groupJidYesGroup JID (e.g. 120363000000000000@g.us)

Implementation Reference

  • The function that registers and implements the 'revoke_invite_code' tool. It defines the handler that POSTs to the Evolution API endpoint /group/revokeInviteCode/{instanceName}?groupJid=... to revoke and regenerate the invite code.
    export function registerRevokeInviteCode(server: McpServer, client: EvolutionClient): void {
      server.registerTool(
        "revoke_invite_code",
        {
          title: "Revoke Invite Code",
          description: "Revoke and regenerate the invite code for a WhatsApp group via the pinned instance.",
          inputSchema: schema,
        },
        async (args) => {
          try {
            const data = await client.post(
              `/group/revokeInviteCode/${client.instanceName}?groupJid=${encodeURIComponent(args.groupJid)}`,
              {}
            );
            return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
          } catch (e) {
            if (e instanceof McpError) return { isError: true, content: [{ type: "text" as const, text: e.message }] };
            throw e;
          }
        }
      );
    }
  • Input validation schema using Zod, requiring a non-empty string for groupJid.
    const schema = {
      groupJid: z.string().min(1).describe("Group JID (e.g. 120363000000000000@g.us)"),
    };
  • Import of registerRevokeInviteCode in the central tools index file.
    import { registerRevokeInviteCode } from "./revoke-invite-code.js";
    import { registerAcceptInvite } from "./accept-invite.js";
    import { registerSendGroupInvite } from "./send-group-invite.js";
    import { registerUpdateParticipants } from "./update-participants.js";
    import { registerUpdateGroupSetting } from "./update-group-setting.js";
    import { registerLeaveGroup } from "./leave-group.js";
    import { registerFindGroupByInvite } from "./find-group-by-invite.js";
    
    // Instance
    import { registerConnectionState } from "./connection-state.js";
    import { registerRestartInstance } from "./restart-instance.js";
    import { registerLogoutInstance } from "./logout-instance.js";
    import { registerGetSettings } from "./get-settings.js";
    import { registerSetSettings } from "./set-settings.js";
    
    // Webhook
    import { registerFindWebhook } from "./find-webhook.js";
    import { registerSetWebhook } from "./set-webhook.js";
    
    // Label
    import { registerFindLabels } from "./find-labels.js";
    import { registerHandleLabel } from "./handle-label.js";
    
    // Block & Misc
    import { registerUpdateBlockStatus } from "./update-block-status.js";
    import { registerCheckNumber } from "./check-number.js";
    
    export function registerAllTools(server: McpServer, client: EvolutionClient): void {
      // Original
      registerListGroups(server, client);
      registerFindChats(server, client);
      registerFindContacts(server, client);
      registerFindMessages(server, client);
      registerGetChatHistory(server, client);
      registerSendText(server, client);
      registerSendMedia(server, client);
      registerGetGroupInfo(server, client);
      registerGetGroupResolvedParticipants(server, client);
    
      // Message
      registerSendAudio(server, client);
      registerSendSticker(server, client);
      registerSendLocation(server, client);
      registerSendContact(server, client);
      registerSendReaction(server, client);
      registerSendPoll(server, client);
      registerSendList(server, client);
      registerSendButton(server, client);
      registerSendStatus(server, client);
    
      // Chat
      registerMarkAsRead(server, client);
      registerArchiveChat(server, client);
      registerDeleteMessage(server, client);
      registerFetchProfilePicture(server, client);
      registerDownloadMedia(server, client);
      registerSendPresence(server, client);
    
      // Profile
      registerFetchBusinessProfile(server, client);
      registerUpdateProfileName(server, client);
      registerUpdateProfileStatus(server, client);
      registerUpdateProfilePicture(server, client);
      registerRemoveProfilePicture(server, client);
      registerFetchPrivacy(server, client);
      registerUpdatePrivacy(server, client);
    
      // Group
      registerCreateGroup(server, client);
      registerUpdateGroupSubject(server, client);
      registerUpdateGroupDescription(server, client);
      registerUpdateGroupPicture(server, client);
      registerFetchInviteCode(server, client);
      registerRevokeInviteCode(server, client);
  • Registration call that wires the tool into the MCP server during initialization.
    registerRevokeInviteCode(server, client);
Behavior2/5

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

No annotations provided, so description bears full burden. It states revoke and regenerate but does not disclose side effects (e.g., invalidating existing invites), permissions required, or idempotency. Lacks important behavioral context.

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?

Single sentence, no fluff, front-loaded with the core action. 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?

Adequate for a simple tool with one param and no output schema, but could explain the regeneration result (e.g., returns new code) and prerequisites (e.g., admin status). Leaves some questions unanswered.

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 a clear description of the single parameter. The tool description adds no additional meaning or context beyond the schema, meeting the baseline for high coverage.

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?

Description uses specific verb 'revoke and regenerate' with clear resource 'invite code for a WhatsApp group via the pinned instance'. It distinctly differentiates from siblings like 'fetch_invite_code' and 'send_group_invite'.

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?

No explicit guidance on when to use or avoid this tool. No mention of alternatives among siblings like 'fetch_invite_code' for reading the current code. Usage is implied but not clarified.

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/billyfranklim1/mcp-evolution'

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