Update Privacy Settings
update_privacyUpdate privacy settings for a WhatsApp instance, controlling who can see read receipts, profile, status, online status, last seen, and who can add to groups or call.
Instructions
Update privacy settings for the pinned WhatsApp instance. Values: all, contacts, contact_blacklist, none.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| readreceipts | No | Who can see read receipts | |
| profile | No | Who can see the profile picture | |
| status | No | Who can see status updates | |
| online | No | Who can see online status | |
| last | No | Who can see last seen | |
| groupadd | No | Who can add to groups | |
| calladd | No | Who can call |
Implementation Reference
- src/tools/update-privacy.ts:18-44 (handler)The registerUpdatePrivacy function registers and implements the 'update_privacy' tool handler. It builds a payload from optional privacy fields (readreceipts, profile, status, online, last, groupadd, calladd) and sends a POST request to Evolution API endpoint /chat/updatePrivacySettings/{instanceName}.
export function registerUpdatePrivacy(server: McpServer, client: EvolutionClient): void { server.registerTool( "update_privacy", { title: "Update Privacy Settings", description: "Update privacy settings for the pinned WhatsApp instance. Values: all, contacts, contact_blacklist, none.", inputSchema: schema, }, async (args) => { try { const payload: Record<string, unknown> = {}; if (args.readreceipts !== undefined) payload["readreceipts"] = args.readreceipts; if (args.profile !== undefined) payload["profile"] = args.profile; if (args.status !== undefined) payload["status"] = args.status; if (args.online !== undefined) payload["online"] = args.online; if (args.last !== undefined) payload["last"] = args.last; if (args.groupadd !== undefined) payload["groupadd"] = args.groupadd; if (args.calladd !== undefined) payload["calladd"] = args.calladd; const data = await client.post(`/chat/updatePrivacySettings/${client.instanceName}`, payload); return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] }; } catch (e) { if (e instanceof McpError) return { isError: true, content: [{ type: "text" as const, text: e.message }] }; throw e; } } ); } - src/tools/update-privacy.ts:1-16 (schema)Zod schema definitions for the 'update_privacy' tool. PrivacyValueSchema is an enum of 'all', 'contacts', 'contact_blacklist', 'none'. The input schema defines optional fields: readreceipts, profile, status, online, last, groupadd, calladd.
import { z } from "zod"; import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { McpError } from "@modelcontextprotocol/sdk/types.js"; import type { EvolutionClient } from "../evolution-client.js"; const PrivacyValueSchema = z.enum(["all", "contacts", "contact_blacklist", "none"]); const schema = { readreceipts: PrivacyValueSchema.optional().describe("Who can see read receipts"), profile: PrivacyValueSchema.optional().describe("Who can see the profile picture"), status: PrivacyValueSchema.optional().describe("Who can see status updates"), online: PrivacyValueSchema.optional().describe("Who can see online status"), last: PrivacyValueSchema.optional().describe("Who can see last seen"), groupadd: PrivacyValueSchema.optional().describe("Who can add to groups"), calladd: PrivacyValueSchema.optional().describe("Who can call"), }; - src/tools/index.ts:41-42 (registration)Import of registerUpdatePrivacy from the update-privacy module.
import { registerUpdatePrivacy } from "./update-privacy.js"; - src/tools/index.ts:114-114 (registration)Registration call that wires up the update_privacy tool to the server and client.
registerUpdatePrivacy(server, client);