Skip to main content
Glama

waha_get_group_participants

Retrieve a list of all members in a WhatsApp group using the group ID to manage group participants and interactions.

Instructions

List all members in a group.

Input Schema

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

Implementation Reference

  • The handler function that implements the core logic for the 'waha_get_group_participants' MCP tool. It extracts the groupId from arguments, validates it, calls the WAHA client to fetch participants, formats the response as JSON, and returns it in the MCP format.
    private async handleGetGroupParticipants(args: any) { const groupId = args.groupId; if (!groupId) { throw new Error("groupId is required"); } const participants = await this.wahaClient.getGroupParticipants(groupId); return { content: [ { type: "text", text: `Group ${groupId} participants (${participants.length}):\n${JSON.stringify(participants, null, 2)}`, }, ], }; }
  • src/index.ts:685-696 (registration)
    Tool registration in the ListTools handler. Defines the tool name, description, and input schema requiring a 'groupId' parameter.
    name: "waha_get_group_participants", description: "List all members in a group.", inputSchema: { type: "object", properties: { groupId: { type: "string", description: "Group ID (format: number@g.us)", }, }, required: ["groupId"], },
  • Input schema definition for the tool, specifying the required 'groupId' string parameter.
    type: "object", properties: { groupId: { type: "string", description: "Group ID (format: number@g.us)", }, }, required: ["groupId"], },
  • WAHAClient helper method that performs the actual HTTP GET request to the WAHA API endpoint for retrieving group participants.
    async getGroupParticipants(groupId: string): Promise<any[]> { if (!groupId) { throw new WAHAError("groupId is required"); } const endpoint = `/api/${this.session}/groups/${encodeURIComponent(groupId)}/participants`; return this.request<any[]>(endpoint, { method: "GET", }); }
  • src/index.ts:1109-1110 (registration)
    Dispatch in the CallToolRequestSchema switch statement that routes calls to the specific handler.
    case "waha_get_group_participants": return await this.handleGetGroupParticipants(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