get_single_list
Retrieve detailed information about a specific mailing list, including total subscriber count and current status, from the Sitecore Send platform.
Instructions
Get a single mailing list details: total count, status, etc
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| listId | Yes | Id of the mailing list |
Implementation Reference
- src/tools/api.ts:30-51 (registration)Registration of the 'get_single_list' tool using server.addTool, defining name, description, schema, annotations, and handler.server.addTool({ name: "get_single_list", description: "Get a single mailing list details: total count, status, etc", parameters: z.object({ listId: z.string().uuid().describe("Id of the mailing list") }), annotations: { title: "Get a single mailing list", openWorldHint: true, }, execute: async ({ listId }) => { const listResponse = await client.lists.getById(listId); const list = listResponse; type Keys = keyof typeof list; const keys = ['Name', 'ActiveMemberCount', 'BouncedMemberCount', 'RemovedMemberCount', 'UnsubscribedMemberCount', 'Preferences', 'StatusValue'] as Keys[]; return { content: [ { type: "text", text: keys.map(x => `- ${x}: '${list[x]}'`).join("\n") } ] } } });
- src/tools/api.ts:40-50 (handler)Handler function that uses SendClient to fetch mailing list details by ID and returns formatted key-value pairs.execute: async ({ listId }) => { const listResponse = await client.lists.getById(listId); const list = listResponse; type Keys = keyof typeof list; const keys = ['Name', 'ActiveMemberCount', 'BouncedMemberCount', 'RemovedMemberCount', 'UnsubscribedMemberCount', 'Preferences', 'StatusValue'] as Keys[]; return { content: [ { type: "text", text: keys.map(x => `- ${x}: '${list[x]}'`).join("\n") } ] } }
- src/tools/api.ts:33-35 (schema)Input schema using Zod, validating listId as a UUID string.parameters: z.object({ listId: z.string().uuid().describe("Id of the mailing list") }),