Skip to main content
Glama
billyfranklim1

mcp-evolution

Fetch Invite Code

fetch_invite_code

Retrieve the invite code or link for a WhatsApp group using its JID. Use to obtain group invitation from the connected instance.

Instructions

Fetch the invite code/link for a WhatsApp group via the pinned instance.

Input Schema

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

Implementation Reference

  • Input schema for fetch_invite_code: requires a groupJid string parameter.
    const schema = {
      groupJid: z.string().min(1).describe("Group JID (e.g. 120363000000000000@g.us)"),
    };
  • Handler function that registers the 'fetch_invite_code' tool. Makes a GET request to /group/inviteCode/{instanceName}?groupJid={groupJid} and returns the invite code data.
    export function registerFetchInviteCode(server: McpServer, client: EvolutionClient): void {
      server.registerTool(
        "fetch_invite_code",
        {
          title: "Fetch Invite Code",
          description: "Fetch the invite code/link for a WhatsApp group via the pinned instance.",
          inputSchema: schema,
        },
        async (args) => {
          try {
            const data = await client.get(
              `/group/inviteCode/${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;
          }
        }
      );
    }
  • Import of registerFetchInviteCode from the fetch-invite-code module.
    import { registerFetchInviteCode } from "./fetch-invite-code.js";
  • Registration call for the fetch_invite_code tool in the central tools index.
    registerFetchInviteCode(server, client);
  • The EvolutionClient.get() method used by the handler to make the HTTP GET request to the Evolution API.
    async get<T = unknown>(path: string): Promise<T> {
      return this.request<T>("GET", path);
    }
Behavior2/5

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

No annotations are provided, so the description must disclose all behavioral traits. It fails to mention that this is a read-only operation, any authentication needs, or what happens if the group JID is invalid or the user is not a member.

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

Conciseness4/5

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

The description is a single, concise sentence with no redundant information. However, it could be slightly expanded to include more context without losing brevity.

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 one parameter and no output schema, the description covers the basic purpose and the parameter is documented in the schema. However, missing details on return value, errors, and behavioral implications lower the completeness to average.

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% for the single parameter, and the description adds no additional meaning beyond the schema's description. Per the baseline, a score of 3 is appropriate.

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 explicitly states the action ('Fetch') and the resource ('invite code/link') with context ('via the pinned instance'), clearly distinguishing from sibling tools like revoke_invite_code and accept_invite.

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 such as revoke_invite_code or accept_invite, and lacks any context on prerequisites or typical scenarios.

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