Send List
send_listSend an interactive list message to a WhatsApp number or group, with a title, description, button text, and sections of rows for user selection.
Instructions
Send a WhatsApp list message (interactive menu) via the pinned instance.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| number | Yes | Recipient JID or phone number (e.g. 5511999999999 or group@g.us) | |
| title | Yes | Message title | |
| description | Yes | Message body/description | |
| buttonText | Yes | Text on the list button (e.g. 'View Options') | |
| footerText | No | Optional footer text | |
| sections | Yes | List sections, each with rows |
Implementation Reference
- src/tools/send-list.ts:27-53 (handler)Main handler function registerSendList that registers the 'send_list' tool. Builds a payload with number, title, description, buttonText, sections, and optional footerText, then POSTs to /message/sendList/{instanceName}.
export function registerSendList(server: McpServer, client: EvolutionClient): void { server.registerTool( "send_list", { title: "Send List", description: "Send a WhatsApp list message (interactive menu) via the pinned instance.", inputSchema: schema, }, async (args) => { try { const payload: Record<string, unknown> = { number: args.number, title: args.title, description: args.description, buttonText: args.buttonText, sections: args.sections, }; if (args.footerText) payload["footerText"] = args.footerText; const data = await client.post(`/message/sendList/${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/send-list.ts:7-25 (schema)Input schema for send_list: defines RowSchema (title, description, rowId), SectionSchema (title, rows), and the top-level input schema (number, title, description, buttonText, footerText, sections).
const RowSchema = z.object({ title: z.string().min(1), description: z.string().optional(), rowId: z.string().optional(), }); const SectionSchema = z.object({ title: z.string().min(1), rows: z.array(RowSchema).min(1), }); const schema = { number: PhoneOrJidSchema, title: z.string().min(1).describe("Message title"), description: z.string().min(1).describe("Message body/description"), buttonText: z.string().min(1).describe("Text on the list button (e.g. 'View Options')"), footerText: z.string().optional().describe("Optional footer text"), sections: z.array(SectionSchema).min(1).describe("List sections, each with rows"), }; - src/tools/index.ts:22-22 (registration)Import of registerSendList from send-list.ts.
import { registerSendList } from "./send-list.js"; - src/tools/index.ts:95-95 (registration)Invocation of registerSendList(server, client) to register the tool on the MCP server.
registerSendList(server, client); - src/schemas.ts:8-11 (helper)PhoneOrJidSchema used by send_list's input schema for the 'number' field.
export const PhoneOrJidSchema = z .string() .min(1) .describe("Recipient JID or phone number (e.g. 5511999999999 or group@g.us)");