Skip to main content
Glama
ExoCubeYT

OpenWA MCP Server

by ExoCubeYT

update_group_subject

Changes the subject/name of a WhatsApp group using session and group IDs. Enables programmatic renaming of group chats.

Instructions

Change the name/subject of a WhatsApp group

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionIdYesSession ID
groupIdYesGroup ID
subjectYesNew group name/subject

Implementation Reference

  • src/index.ts:18-18 (registration)
    Registers all group tools (including update_group_subject) via registerGroupTools(server).
    registerGroupTools(server);
  • Exported function that registers group tools on the McpServer instance.
    export function registerGroupTools(server: McpServer) {
  • Handler for 'update_group_subject' tool: sends PUT request to /sessions/{sessionId}/groups/{groupId} with new subject in body.
    server.registerTool(
      "update_group_subject",
      {
        description: "Change the name/subject of a WhatsApp group",
        inputSchema: {
          sessionId: z.string().describe("Session ID"),
          groupId: z.string().describe("Group ID"),
          subject: z.string().describe("New group name/subject"),
        },
      },
      async ({ sessionId, groupId, subject }) => {
        const data = await openwaClient({
          method: "PUT",
          path: `/sessions/${sessionId}/groups/${groupId}`,
          body: { subject },
        });
        return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
      }
    );
  • Input schema for update_group_subject: sessionId (string), groupId (string), subject (string).
    inputSchema: {
      sessionId: z.string().describe("Session ID"),
      groupId: z.string().describe("Group ID"),
      subject: z.string().describe("New group name/subject"),
    },
  • Generic HTTP client used by the handler to call 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 {
        return JSON.parse(text) as T;
      } catch {
        return text as T;
      }
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of disclosure. It only states the action, omitting any behavioral traits such as whether the change is reversible, if other members are notified, or if any validation occurs (e.g., group existence).

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 a single sentence, no redundant words, and the action is immediately clear. It is appropriately concise.

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?

Given no output schema and no annotations, the description is too sparse. It does not mention return values, error conditions, or preconditions (e.g., the group must exist and the session must be active). A mutation tool of this nature requires more contextual information for an AI agent to use it correctly.

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 baseline is 3. The description adds minimal meaning beyond the schema, primarily linking the 'subject' parameter to the tool's purpose. It does not clarify the format or constraints on the 'sessionId' and 'groupId' 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 clearly states the action ('Change') and the resource ('name/subject of a WhatsApp group'), using a specific verb and resource combination that distinguishes this tool from siblings like 'create_group' or 'add_group_member'.

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?

No guidance is provided on when to use this tool versus alternatives, nor are there any prerequisites (e.g., group ownership or admin rights). The description lacks both positive and negative usage context.

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