Skip to main content
Glama

unsubscribe_subscriber

Remove a subscriber's email from a mailing list to manage email preferences and comply with unsubscribe requests.

Instructions

Unsubscribe subscriber from a mailing list

Input Schema

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

Implementation Reference

  • Handler function that executes the unsubscribe operation by calling the SendClient's subscribers.unsubscribe method and returns success or error message.
    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 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 '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}` } ] } } } });

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