get_lists
Retrieve all available mailing lists from Sitecore Send to manage email campaigns and audience segmentation.
Instructions
Get all available mailing lists
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_lists"
}
}Input 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") } ] } } });