Skip to main content
Glama

unsubscribe_subscriber

Remove a subscriber from a mailing list by specifying the list ID and subscriber email using the MCP server for Sitecore Send.

Instructions

Unsubscribe subscriber from a mailing list

Input Schema

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

Implementation Reference

  • The handler function that executes the unsubscribe_subscriber tool by calling the SendClient API to unsubscribe the subscriber from the specified mailing list, with error handling.
    execute: async ({ listId, email }) => { try { await client.subscribers.unsubscribe(listId, email); return { content: [ { type: "text", text: `Subscriber '${email}' successfully unsubscribed from mailing list '${listId}'` } ] } } catch (e) { return { content: [ { type: "text", text: `Error: ${(e as ApiResponseError).sendResponse?.Error}` } ] } } }
  • Zod schema defining the input parameters: listId (UUID) and email for the unsubscribe_subscriber tool.
    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 unsubscribe_subscriber tool using server.addTool, including name, description, schema, annotations, and handler.
    server.addTool({ name: "unsubscribe_subscriber", description: "Unsubscribe subscriber from a mailing list", parameters: z.object({ listId: z.string().uuid().describe("Id of the mailing list"), email: z.string().email().describe("Email of the subscriber") }), annotations: { title: "Unsubscribe subscriber from a mailing list", openWorldHint: true, }, execute: async ({ listId, email }) => { try { await client.subscribers.unsubscribe(listId, email); return { content: [ { type: "text", text: `Subscriber '${email}' successfully unsubscribed from mailing list '${listId}'` } ] } } 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