Skip to main content
Glama
wsapi-chat
by wsapi-chat

whatsapp_set_account_presence

Set your WhatsApp account presence status to available or unavailable. Control your online visibility and manage session activity through the WSAPI WhatsApp MCP Server.

Instructions

Set account presence status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
statusYesPresence status

Implementation Reference

  • The primary handler implementation for the whatsapp_set_account_presence tool. Validates input with setAccountPresenceSchema, makes API call to set presence via wsapiClient, and returns success response.
    export const setAccountPresence: ToolHandler = { name: 'whatsapp_set_account_presence', description: 'Set account presence status.', inputSchema: { type: 'object', properties: { status: { type: 'string', enum: ['available', 'unavailable'], description: 'Presence status' }, }, required: ['status'], }, handler: async (args: any) => { const input = validateInput(setAccountPresenceSchema, args); logger.info('Setting account presence'); await wsapiClient.put('/account/presence', input); return { success: true, message: 'Account presence updated successfully' }; }, };
  • Zod schema used for input validation in the whatsapp_set_account_presence handler. Defines 'status' as enum of 'available' or 'unavailable'.
    export const setAccountPresenceSchema = z.object({ status: z.enum(['available', 'unavailable']), });
  • src/server.ts:53-79 (registration)
    Tool registration logic in the MCP server. accountTools (containing whatsapp_set_account_presence) is included in toolCategories and registered into the server's tools Map for handling tool calls.
    private setupToolHandlers(): void { logger.info('Setting up tool handlers'); // Register all tool categories const toolCategories = [ messagingTools, contactTools, groupTools, chatTools, sessionTools, instanceTools, accountTools, ]; toolCategories.forEach(category => { Object.values(category).forEach(tool => { if (this.tools.has(tool.name)) { logger.warn(`Tool ${tool.name} already registered, skipping`); return; } this.tools.set(tool.name, tool); logger.debug(`Registered tool: ${tool.name}`); }); }); logger.info(`Registered ${this.tools.size} tools`); }
  • Export of accountTools object grouping account-related tools including whatsapp_set_account_presence for registration in the server.
    export const accountTools = { getAccountInfo, setAccountName, setAccountPicture, setAccountPresence, setAccountStatus };
  • Inline inputSchema in the ToolHandler definition, matching the Zod schema, used by MCP SDK for tool input description.
    inputSchema: { type: 'object', properties: { status: { type: 'string', enum: ['available', 'unavailable'], description: 'Presence status' }, }, required: ['status'], },

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/wsapi-chat/wsapi-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server