Fetch Privacy Settings
fetch_privacyFetch the current privacy settings of a pinned WhatsApp instance for review or verification.
Instructions
Fetch the current privacy settings of the pinned WhatsApp instance.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/fetch-privacy.ts:5-23 (handler)The main handler function for the 'fetch_privacy' tool. It registers the tool with the MCP server, defining an empty inputSchema, and on execution calls the Evolution API endpoint `/chat/fetchPrivacySettings/{instanceName}` to fetch privacy settings, returning the result as JSON.
export function registerFetchPrivacy(server: McpServer, client: EvolutionClient): void { server.registerTool( "fetch_privacy", { title: "Fetch Privacy Settings", description: "Fetch the current privacy settings of the pinned WhatsApp instance.", inputSchema: {}, }, async () => { try { const data = await client.get(`/chat/fetchPrivacySettings/${client.instanceName}`); 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/fetch-privacy.ts:6-22 (registration)The tool registration via server.registerTool('fetch_privacy', ...) which wires the tool name to its schema and handler.
server.registerTool( "fetch_privacy", { title: "Fetch Privacy Settings", description: "Fetch the current privacy settings of the pinned WhatsApp instance.", inputSchema: {}, }, async () => { try { const data = await client.get(`/chat/fetchPrivacySettings/${client.instanceName}`); 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/index.ts:40-40 (registration)Import of registerFetchPrivacy from the fetch-privacy module.
import { registerFetchPrivacy } from "./fetch-privacy.js"; - src/tools/index.ts:113-113 (registration)Registration call registerFetchPrivacy(server, client) invoked in registerAllTools.
registerFetchPrivacy(server, client);