Skip to main content
Glama

waha_demote_group_admin

Remove admin privileges from participants in a WhatsApp group. Requires admin access to manage group permissions and maintain appropriate access levels.

Instructions

Remove admin privileges from participant(s). Requires admin privileges.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
groupIdYesGroup ID (format: number@g.us)
participantsYesJSON array of participants to demote (format: [{'id': 'number@c.us'}, ...])

Implementation Reference

  • MCP tool handler: parses input args (groupId and JSON participants), calls wahaClient.demoteGroupAdmin, returns formatted success response with result.
    private async handleDemoteGroupAdmin(args: any) {
      const groupId = args.groupId;
      const participantsStr = args.participants;
    
      if (!groupId) {
        throw new Error("groupId is required");
      }
    
      if (!participantsStr) {
        throw new Error("participants is required");
      }
    
      const participants = JSON.parse(participantsStr);
    
      const result = await this.wahaClient.demoteGroupAdmin({
        groupId,
        participants,
      });
    
      return {
        content: [
          {
            type: "text",
            text: `Successfully demoted ${participants.length} admin(s) in group ${groupId}.\n${JSON.stringify(result, null, 2)}`,
          },
        ],
      };
    }
  • Tool schema: defines input parameters groupId (string) and participants (JSON string array of {id: string}), both required.
      name: "waha_demote_group_admin",
      description: "Remove admin privileges from participant(s). Requires admin privileges.",
      inputSchema: {
        type: "object",
        properties: {
          groupId: {
            type: "string",
            description: "Group ID (format: number@g.us)",
          },
          participants: {
            type: "string",
            description: "JSON array of participants to demote (format: [{'id': 'number@c.us'}, ...])",
          },
        },
        required: ["groupId", "participants"],
      },
    },
  • src/index.ts:1117-1118 (registration)
    Tool registration in CallToolRequestSchema dispatcher switch statement.
    case "waha_demote_group_admin":
      return await this.handleDemoteGroupAdmin(args);
  • WAHAClient helper method: performs HTTP POST to WAHA API endpoint /groups/{groupId}/admin/demote with participants array.
    async demoteGroupAdmin(params: {
      groupId: string;
      participants: Array<{ id: string }>;
    }): Promise<any> {
      const { groupId, participants } = params;
    
      if (!groupId) {
        throw new WAHAError("groupId is required");
      }
    
      if (!participants || participants.length === 0) {
        throw new WAHAError("participants array is required");
      }
    
      const endpoint = `/api/${this.session}/groups/${encodeURIComponent(groupId)}/admin/demote`;
    
      const body = { participants };
    
      return this.request<any>(endpoint, {
        method: "POST",
        body: JSON.stringify(body),
      });
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions the admin privilege requirement, which is useful, but lacks details on effects (e.g., whether demotion is reversible, if participants retain group access, error conditions, or rate limits). For a mutation tool with zero annotation coverage, this leaves significant gaps in understanding the tool's behavior.

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 two short sentences with zero wasted words, front-loading the core action and following with a critical prerequisite. Every sentence earns its place by providing essential information efficiently.

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 this is a mutation tool with no annotations and no output schema, the description is incomplete. It lacks details on return values, error handling, side effects, and how it differs from related tools like 'waha_promote_group_admin'. For a tool that modifies group permissions, more context is needed to ensure safe and correct usage.

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 schema already fully documents both parameters (groupId and participants). The description adds no additional parameter semantics beyond what's in the schema, such as format examples or validation rules. Baseline 3 is appropriate when the schema handles all parameter documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Remove admin privileges') and target ('from participant(s)'), providing a specific verb+resource combination. However, it doesn't explicitly differentiate from its sibling 'waha_promote_group_admin' beyond the opposite action, missing a direct comparison that would earn a perfect score.

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?

The description includes a prerequisite ('Requires admin privileges'), which gives some context for when to use it, but it doesn't specify when to choose this tool over alternatives like 'waha_remove_group_participants' or clarify scenarios where demotion is appropriate versus removal. This provides implied but incomplete guidance.

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