get_lists
Retrieve all available mailing lists from Sitecore Send to manage email campaigns and audience segmentation.
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)Handler function for the 'get_lists' tool. It fetches all mailing lists using client.lists.getAll(), maps them to a formatted string list including name, status, and ID, 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 on the FastMCP server, specifying name, description, annotations, and the execute handler. No input parameters defined.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") } ] } } });