whatsapp_get_session_status
Check WhatsApp session status to verify connectivity and readiness for messaging operations.
Instructions
Get current WhatsApp session status.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/session.ts:8-17 (handler)The main tool handler for 'whatsapp_get_session_status'. It fetches the session status from the WSAPI client and returns it with success status.export const getSessionStatus: ToolHandler = { name: 'whatsapp_get_session_status', description: 'Get current WhatsApp session status.', inputSchema: { type: 'object', properties: {} }, handler: async () => { logger.info('Getting session status'); const result = await wsapiClient.get('/session/status'); return { success: true, status: result, message: 'Session status retrieved successfully' }; }, };
- src/server.ts:53-79 (registration)Registers the sessionTools object (containing whatsapp_get_session_status) along with other tools into the MCP server's tool registry map.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`); }
- src/tools/session.ts:11-11 (schema)Input schema for the tool, which expects no parameters (empty object).inputSchema: { type: 'object', properties: {} },