get_lists
Retrieve all available mailing lists from the Sitecore Send MCP server using this tool. Simplify list management and integration tasks efficiently.
Instructions
Get all available mailing lists
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/api.ts:19-27 (handler)The execute handler function that retrieves all mailing lists using the SendClient, maps them to a formatted string list, and returns a text content response.execute: async () => { const lists = await client.lists.getAll(); const result = lists.MailingLists.map(x => `- '${x.Name}', status: '${x.StatusValue}', (id: '${x.ID}')`); return { content: [ { type: "text", text: result.join("\n") } ] } }
- src/tools/api.ts:12-28 (registration)Registration of the 'get_lists' tool using server.addTool, including name, description, annotations, and inline execute handler.server.addTool({ name: "get_lists", description: "Get all available mailing lists", annotations: { title: "Get all available mailing lists", openWorldHint: true, }, execute: async () => { const lists = await client.lists.getAll(); const result = lists.MailingLists.map(x => `- '${x.Name}', status: '${x.StatusValue}', (id: '${x.ID}')`); return { content: [ { type: "text", text: result.join("\n") } ] } } });