Skip to main content
Glama
ExoCubeYT

OpenWA MCP Server

by ExoCubeYT

create_group

Create a new WhatsApp group by specifying a group name and adding participants using their phone IDs.

Instructions

Create a new WhatsApp group with specified participants

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionIdYesSession ID
nameYesGroup name
participantsYesArray of participant phone IDs to add

Implementation Reference

  • The handler function for the 'create_group' tool. It accepts sessionId, name, and participants, then makes a POST request to /sessions/{sessionId}/groups with the group name and participants array.
      async ({ sessionId, name, participants }) => {
        const data = await openwaClient({
          method: "POST",
          path: `/sessions/${sessionId}/groups`,
          body: { name, participants },
        });
        return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
      }
    );
  • Input schema/type definitions for the 'create_group' tool using Zod: sessionId (string), name (string), and participants (array of strings).
    inputSchema: {
      sessionId: z.string().describe("Session ID"),
      name: z.string().describe("Group name"),
      participants: z.array(z.string()).describe("Array of participant phone IDs to add"),
    },
  • Registration of the 'create_group' tool on the MCP server via server.registerTool().
    server.registerTool(
      "create_group",
      {
        description: "Create a new WhatsApp group with specified participants",
        inputSchema: {
          sessionId: z.string().describe("Session ID"),
          name: z.string().describe("Group name"),
          participants: z.array(z.string()).describe("Array of participant phone IDs to add"),
        },
      },
      async ({ sessionId, name, participants }) => {
        const data = await openwaClient({
          method: "POST",
          path: `/sessions/${sessionId}/groups`,
          body: { name, participants },
        });
        return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
      }
    );
  • src/index.ts:7-18 (registration)
    Import of registerGroupTools from groups.ts and invocation at line 18 to register all group tools including 'create_group'.
    import { registerGroupTools } from "./tools/groups.js";
    import { registerContactTools } from "./tools/contacts.js";
    import { registerWebhookTools } from "./tools/webhooks.js";
    import { registerLabelTools } from "./tools/labels.js";
    import { registerMediaTools } from "./tools/media.js";
    
    const server = new McpServer({ name: "openwa-mcp", version: "1.0.0" });
    
    registerSessionTools(server);
    registerMessageTools(server);
    registerBulkTools(server);
    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 {
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. It only states the creation action without disclosing authorization needs, rate limits, or side effects beyond the obvious mutation.

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, front-loaded sentence with no wasted words; every part is essential.

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?

No output schema exists, and the description omits return value or confirmation. For a creation tool, it lacks completeness.

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% so baseline is 3. The description adds no extra meaning beyond what the schema already provides for the parameters.

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 'Create a new WhatsApp group with specified participants' clearly states the verb and resource, distinguishing it from siblings like 'add_group_member' which adds to existing groups.

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?

Usage context is implied (use to create a group), but no explicit guidance on when to use vs alternatives, nor any prerequisites or exclusions.

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