Skip to main content
Glama
izharikov

Sitecore Send

add_subscriber

Add a new subscriber to a Sitecore Send mailing list by providing their email address and list ID, enabling targeted email marketing campaigns.

Instructions

Add subscriber to a mailing list

Input Schema

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

Implementation Reference

  • The execute handler function that adds a subscriber to the specified mailing list using the SendClient API, handling success and error responses.
    execute: async ({ listId, email, name, tags }) => {
      try {
        const response = await client.subscribers.add(listId, { Email: email, Name: name, Tags: tags });
        return {
          content: [
            { type: "text", text: `Subscriber '${response.Email}' successfully added to mailing list '${listId}'` }
          ]
        }
      }
      catch (e) {
        return {
          content: [
            { type: "text", text: `Error: ${(e as ApiResponseError).sendResponse?.Error}` }
          ]
        }
      }
    }
  • Zod schema defining the input parameters for the add_subscriber tool: listId (UUID), email, optional name and tags.
    parameters: z.object({
      listId: z.string().uuid().describe("Id of the mailing list"),
      email: z.string().email().describe("Email of the subscriber"),
      name: z.string().optional().describe("Name of the subscriber"),
      tags: z.array(z.string()).optional().describe("Tags of the subscriber")
    }),
  • Registration of the 'add_subscriber' tool using server.addTool, including name, description, schema, annotations, and execute handler.
    server.addTool({
      name: "add_subscriber",
      description: "Add subscriber to 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"),
        name: z.string().optional().describe("Name of the subscriber"),
        tags: z.array(z.string()).optional().describe("Tags of the subscriber")
      }),
      annotations: {
        title: "Add subscriber to a mailing list",
        openWorldHint: true,
      },
      execute: async ({ listId, email, name, tags }) => {
        try {
          const response = await client.subscribers.add(listId, { Email: email, Name: name, Tags: tags });
          return {
            content: [
              { type: "text", text: `Subscriber '${response.Email}' successfully added to mailing list '${listId}'` }
            ]
          }
        }
        catch (e) {
          return {
            content: [
              { type: "text", text: `Error: ${(e as ApiResponseError).sendResponse?.Error}` }
            ]
          }
        }
      }
    });
  • src/tools/index.ts:7-9 (registration)
    High-level tool registration function that calls addApiTools, which includes registering the 'add_subscriber' tool.
      addSmptTools(server, config.smtp);
      addApiTools(server, config.api, config.transactionalEmails);
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations include 'openWorldHint: true', indicating the tool may handle unknown inputs gracefully, but the description doesn't add behavioral context beyond this. It doesn't disclose potential side effects (e.g., email notifications, duplicate handling), authentication needs, or rate limits, though it doesn't contradict annotations either.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (4 parameters, 2 required) and lack of output schema, the description is minimally adequate. It covers the basic purpose but omits details about return values, error conditions, or integration with sibling tools, leaving gaps for the agent to navigate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema description coverage, all parameters are documented in the schema (listId, email, name, tags). The description adds no additional meaning about parameter usage, constraints, or examples, so it meets the baseline for high schema coverage without compensating value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Add subscriber') and target resource ('to a mailing list'), which is specific and unambiguous. However, it doesn't distinguish this tool from sibling tools like 'get_subscriber_by_email' or 'unsubscribe_subscriber' by explaining its unique role in the subscriber lifecycle.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'get_subscribers' or 'unsubscribe_subscriber'. It lacks context about prerequisites (e.g., needing a valid listId), exclusions, or typical workflows, leaving the agent to infer usage from the tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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