Skip to main content
Glama
izharikov

Sitecore Send

get_subscribers

Retrieve subscriber data from a Sitecore Send mailing list to manage contacts and analyze audience engagement.

Instructions

Get subscribers of a mailing list

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
listIdYesId of the mailing list

Implementation Reference

  • Handler function that retrieves subscribers from a specified mailing list using SendClient, maps them to a formatted string list, and returns as text content.
    execute: async ({ listId }) => {
      const response = await client.subscribers.fromList(listId);
      const result = response.Subscribers.map(x => `- '${x.Email}', Name: '${x.Name}', Tags: [${x.Tags.join(", ")}]`);
      return {
        content: [
          { type: "text", text: result.join("\n") }
        ]
      }
    },
  • Zod schema defining the input parameter: listId as a UUID string.
    parameters: z.object({
      listId: z.string().uuid().describe("Id of the mailing list")
    }),
  • src/tools/api.ts:53-72 (registration)
    Registration of the 'get_subscribers' tool using server.addTool, including name, description, schema, annotations, and handler.
    server.addTool({
      name: "get_subscribers",
      description: "Get subscribers of a mailing list",
      parameters: z.object({
        listId: z.string().uuid().describe("Id of the mailing list")
      }),
      annotations: {
        title: "Get subscribers of a mailing list",
        openWorldHint: true,
      },
      execute: async ({ listId }) => {
        const response = await client.subscribers.fromList(listId);
        const result = response.Subscribers.map(x => `- '${x.Email}', Name: '${x.Name}', Tags: [${x.Tags.join(", ")}]`);
        return {
          content: [
            { type: "text", text: result.join("\n") }
          ]
        }
      },
    });

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/izharikov/send-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server