Skip to main content
Glama

get_subscriber_by_email

Retrieve subscriber details from a Sitecore Send mailing list using their email address to access contact information and engagement data.

Instructions

Get subscriber by email

Input Schema

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

Implementation Reference

  • The execute function that implements the tool logic: fetches subscriber by email using the SendClient and returns formatted details or error.
    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 for 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") }),
  • Tool registration via server.addTool, defining 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}` } ] } } }, });

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