Skip to main content
Glama

get_subscriber_by_email

Retrieve subscriber details from a Sitecore Send mailing list using a specific email address and list ID for targeted communications.

Instructions

Get subscriber by email

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
emailYesEmail of the subscriber
listIdYesId of the mailing list

Implementation Reference

  • The main handler function that executes the tool logic: fetches subscriber details by email from a specific list using SendClient, formats key fields (Email, Name, Tags), handles errors.
    execute: async ({ listId, email }) => { try { const response = await client.subscribers.findByEmail(listId, email); type Keys = keyof typeof response; const keys = ['Email', 'Name', 'Tags'] as Keys[]; return { content: [ { type: "text", text: keys.map(x => `- ${x}: '${response[x]}'`).join("\n") } ] } } catch (e) { return { content: [ { type: "text", text: `Error: ${(e as ApiResponseError).sendResponse?.Error}` } ] } } },
  • Zod schema defining input parameters: listId (UUID) and email.
    parameters: z.object({ listId: z.string().uuid().describe("Id of the mailing list"), email: z.string().email().describe("Email of the subscriber") }),
  • Registration of the tool using server.addTool, including name, description, schema, annotations, and handler.
    server.addTool({ name: "get_subscriber_by_email", description: "Get subscriber by email", parameters: z.object({ listId: z.string().uuid().describe("Id of the mailing list"), email: z.string().email().describe("Email of the subscriber") }), annotations: { title: "Get subscriber by email", openWorldHint: true, }, execute: async ({ listId, email }) => { try { const response = await client.subscribers.findByEmail(listId, email); type Keys = keyof typeof response; const keys = ['Email', 'Name', 'Tags'] as Keys[]; return { content: [ { type: "text", text: keys.map(x => `- ${x}: '${response[x]}'`).join("\n") } ] } } catch (e) { return { content: [ { type: "text", text: `Error: ${(e as ApiResponseError).sendResponse?.Error}` } ] } } }, });

Other Tools

Related Tools

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