get_single_list
Retrieve detailed information about a specific mailing list, including total count and status, using the list ID in the Sitecore Send MCP Server.
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:40-50 (handler)The execute handler function that retrieves a single mailing list by ID using SendClient.lists.getById, extracts specific keys, and returns formatted text output.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)Zod input schema defining the listId parameter as a UUID string.parameters: z.object({ listId: z.string().uuid().describe("Id of the mailing list") }),
- src/tools/api.ts:30-51 (registration)The server.addTool call registering the 'get_single_list' tool with name, description, parameters schema, annotations, and execute 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") } ] } } });