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);
Behavior3/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 behavioral disclosure. It successfully indicates this is a mutation tool (toggle action) and specifies an important prerequisite (admin privileges), but doesn't describe what happens when toggled, whether changes are reversible, or any rate limits/error conditions. It provides basic but incomplete behavioral context.

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 perfectly concise with two sentences that each earn their place: the first states the core functionality, the second provides crucial prerequisite information. No wasted words, well-structured, and front-loaded with the main purpose.

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 mutation tool with no annotations and no output schema, the description provides adequate basic information about purpose and prerequisites. However, it doesn't describe what the tool returns, what happens on success/failure, or provide complete behavioral context. Given the complexity of group permission management, more completeness would be beneficial.

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 the input schema already fully documents both parameters (groupId format and adminsOnly meaning). The description doesn't add any parameter-specific information beyond what's in the schema, so it meets the baseline expectation but doesn't provide additional semantic context.

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 specific action ('Toggle whether only admins can send messages') and identifies the resource (group messaging permissions). It distinguishes from siblings like 'waha_set_group_info_admin_only' by focusing specifically on message-sending permissions rather than general group info settings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context about when to use this tool ('Requires admin privileges'), indicating it's for administrators managing group permissions. However, it doesn't explicitly state when NOT to use it or mention specific alternatives among the sibling tools for related group management tasks.

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/seejux/waha-whatsapp-mcp'

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