Skip to main content
Glama

waha_set_group_messages_admin_only

Control group messaging permissions by restricting message sending to administrators only or allowing all members to participate.

Instructions

Toggle whether only admins can send messages. Requires admin privileges.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
groupIdYesGroup ID (format: number@g.us)
adminsOnlyYesTrue = only admins can send, false = all members can send

Implementation Reference

  • MCP tool handler function that extracts parameters, validates inputs, calls the WAHA client method, and returns success message.
    private async handleSetGroupMessagesAdminOnly(args: any) { const groupId = args.groupId; const adminsOnly = args.adminsOnly; if (!groupId) { throw new Error("groupId is required"); } if (adminsOnly === undefined) { throw new Error("adminsOnly is required"); } await this.wahaClient.setGroupMessagesAdminOnly({ groupId, adminsOnly, }); return { content: [ { type: "text", text: `Successfully set group ${groupId} messages to ${adminsOnly ? 'admins only' : 'all members'}.`, }, ], }; }
  • src/index.ts:827-843 (registration)
    Tool registration in the list of available tools, including name, description, and input schema definition.
    name: "waha_set_group_messages_admin_only", description: "Toggle whether only admins can send messages. Requires admin privileges.", inputSchema: { type: "object", properties: { groupId: { type: "string", description: "Group ID (format: number@g.us)", }, adminsOnly: { type: "boolean", description: "True = only admins can send, false = all members can send", }, }, required: ["groupId", "adminsOnly"], }, },
  • WAHA client method that performs the actual HTTP PUT request to the WAHA API to toggle the group setting.
    async setGroupMessagesAdminOnly(params: { groupId: string; adminsOnly: boolean; }): Promise<void> { const { groupId, adminsOnly } = params; if (!groupId) { throw new WAHAError("groupId is required"); } if (adminsOnly === undefined) { throw new WAHAError("adminsOnly is required"); } const endpoint = `/api/${this.session}/groups/${encodeURIComponent(groupId)}/settings/security/messages-admin-only`; const body = { adminsOnly }; await this.request<void>(endpoint, { method: "PUT", body: JSON.stringify(body), }); }
  • src/index.ts:1127-1128 (registration)
    Dispatch case in the CallToolRequestSchema handler that routes the tool call to the specific handler function.
    case "waha_set_group_messages_admin_only": return await this.handleSetGroupMessagesAdminOnly(args);

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