Skip to main content
Glama

waha_update_group_subject

Change the name of a WhatsApp group by providing the group ID and new subject, enabling group management through the WAHA MCP Server.

Instructions

Change group name/subject.

Input Schema

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

Implementation Reference

  • Main handler function for waha_update_group_subject tool. Validates input, calls WAHAClient.updateGroupSubject, and returns success message.
    private async handleUpdateGroupSubject(args: any) {
      const groupId = args.groupId;
      const subject = args.subject;
    
      if (!groupId) {
        throw new Error("groupId is required");
      }
    
      if (!subject) {
        throw new Error("subject is required");
      }
    
      await this.wahaClient.updateGroupSubject({
        groupId,
        subject,
      });
    
      return {
        content: [
          {
            type: "text",
            text: `Successfully updated group ${groupId} name to "${subject}".`,
          },
        ],
      };
    }
  • Tool schema definition including input validation for groupId and subject parameters.
      name: "waha_update_group_subject",
      description: "Change group name/subject.",
      inputSchema: {
        type: "object",
        properties: {
          groupId: {
            type: "string",
            description: "Group ID (format: number@g.us)",
          },
          subject: {
            type: "string",
            description: "New group name",
          },
        },
        required: ["groupId", "subject"],
      },
    },
  • src/index.ts:1103-1106 (registration)
    Tool dispatch registration in the CallToolRequestSchema switch statement.
    case "waha_update_group_subject":
      return await this.handleUpdateGroupSubject(args);
    case "waha_update_group_description":
      return await this.handleUpdateGroupDescription(args);
  • Underlying WAHAClient helper method that performs the HTTP PUT request to update the group subject via WAHA API.
    async updateGroupSubject(params: {
      groupId: string;
      subject: string;
    }): Promise<void> {
      const { groupId, subject } = params;
    
      if (!groupId) {
        throw new WAHAError("groupId is required");
      }
    
      if (!subject) {
        throw new WAHAError("subject is required");
      }
    
      const endpoint = `/api/${this.session}/groups/${encodeURIComponent(groupId)}/subject`;
    
      const body = { subject };
    
      await this.request<void>(endpoint, {
        method: "PUT",
        body: JSON.stringify(body),
      });
    }

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-mcp'

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