run_group_audit
Analyze WhatsApp group memberships to identify overlapping members, members with no direct chat, and members not in your contacts.
Instructions
Run a combined group-membership audit (overlaps, no direct chat, not in contacts).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| group_limit | No | How many groups to scan | |
| refresh_group_info | No | Fetch live group metadata before analysis | |
| overlap_min_shared_groups | No | Threshold for overlap list | |
| min_shared_groups | No | Threshold for no-direct-chat and not-in-contacts lists |
Implementation Reference
- src/tools/chats.ts:466-526 (registration)Registration of the 'run_group_audit' tool via server.tool() with Zod schema params and handler calling whatsappService.runGroupAudit().
server.tool( "run_group_audit", "Run a combined group-membership audit (overlaps, no direct chat, not in contacts).", { group_limit: z .number() .int() .positive() .optional() .default(200) .describe("How many groups to scan"), refresh_group_info: z .boolean() .optional() .default(false) .describe("Fetch live group metadata before analysis"), overlap_min_shared_groups: z .number() .int() .positive() .optional() .default(2) .describe("Threshold for overlap list"), min_shared_groups: z .number() .int() .positive() .optional() .default(1) .describe("Threshold for no-direct-chat and not-in-contacts lists"), }, async ({ group_limit, refresh_group_info, overlap_min_shared_groups, min_shared_groups, }): Promise<CallToolResult> => { try { const result = await whatsappService.runGroupAudit( group_limit, refresh_group_info, overlap_min_shared_groups, min_shared_groups, ); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; } catch (error: any) { log.error("Error in run_group_audit tool:", error); return { content: [ { type: "text", text: `Error running group audit: ${error?.message || String(error)}`, }, ], isError: true, }; } }, ); - src/tools/chats.ts:469-496 (schema)Input schema for run_group_audit: group_limit (default 200), refresh_group_info (default false), overlap_min_shared_groups (default 2), min_shared_groups (default 1).
{ group_limit: z .number() .int() .positive() .optional() .default(200) .describe("How many groups to scan"), refresh_group_info: z .boolean() .optional() .default(false) .describe("Fetch live group metadata before analysis"), overlap_min_shared_groups: z .number() .int() .positive() .optional() .default(2) .describe("Threshold for overlap list"), min_shared_groups: z .number() .int() .positive() .optional() .default(1) .describe("Threshold for no-direct-chat and not-in-contacts lists"), },