list-recent-contacts
Retrieve recently contacted WhatsApp users to quickly access conversation history or initiate new messages without manual searching.
Instructions
List recently contacted people on WhatsApp (simplified)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:182-210 (registration)Registration of the 'list-recent-contacts' tool with server.tool(). Includes tool name, description, empty schema, and inline handler function.// Tool to list recent WhatsApp contacts (simplified version) server.tool( "list-recent-contacts", "List recently contacted people on WhatsApp (simplified)", {}, async () => { try { return { content: [ { type: "text", text: "Due to WhatsApp's privacy protections, listing contacts programmatically is limited. " + "Please specify the exact contact name when sending messages.", } ] }; } catch (error) { return { content: [ { type: "text", text: `Error listing contacts: ${error}`, } ], isError: true }; } } );
- src/index.ts:187-209 (handler)Inline handler function for the tool. Returns a standardized message about privacy limitations or an error response.async () => { try { return { content: [ { type: "text", text: "Due to WhatsApp's privacy protections, listing contacts programmatically is limited. " + "Please specify the exact contact name when sending messages.", } ] }; } catch (error) { return { content: [ { type: "text", text: `Error listing contacts: ${error}`, } ], isError: true }; } }