Skip to main content
Glama
dazanza
by dazanza

add_or_update_member

Add new subscribers or update existing ones in Mailchimp audiences using email as the unique identifier. Maintains current subscription status while managing contact information and tags.

Instructions

Add a new subscriber or update an existing one in a Mailchimp audience. Uses email as the unique key (upsert). Will not change subscription status of existing members.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
list_idYesAudience/list ID
emailYesEmail address of the contact
first_nameNoFirst name
last_nameNoLast name
tagsNoTags to apply (e.g. ['Lead', 'Strategy'])

Implementation Reference

  • The handler function for 'add_or_update_member', which processes the input parameters, hashes the email, calls Mailchimp API to set the member, and optionally applies tags.
    async ({ list_id, email, first_name, last_name, tags }) => {
      const subscriberHash = crypto.createHash("md5").update(email.toLowerCase()).digest("hex");
      const body = {
        email_address: email,
        status_if_new: "subscribed",
        merge_fields: {},
      };
      if (first_name) body.merge_fields.FNAME = first_name;
      if (last_name) body.merge_fields.LNAME = last_name;
      const result = await mailchimp.lists.setListMember(list_id, subscriberHash, body);
      if (tags && tags.length > 0) {
        await mailchimp.lists.updateListMemberTags(list_id, subscriberHash, {
          tags: tags.map((t) => ({ name: t, status: "active" })),
        });
      }
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(
              {
                success: true,
                email: result.email_address,
                status: result.status,
                is_new: result.status === "subscribed" && !result.last_changed,
                tags_applied: tags || [],
              },
              null,
  • server.js:339-348 (registration)
    The registration of the 'add_or_update_member' tool, including its schema definition.
    server.tool(
      "add_or_update_member",
      "Add a new subscriber or update an existing one in a Mailchimp audience. Uses email as the unique key (upsert). Will not change subscription status of existing members.",
      {
        list_id: z.string().describe("Audience/list ID"),
        email: z.string().describe("Email address of the contact"),
        first_name: z.string().optional().describe("First name"),
        last_name: z.string().optional().describe("Last name"),
        tags: z.array(z.string()).optional().describe("Tags to apply (e.g. ['Lead', 'Strategy'])"),
      },
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively explains the upsert behavior ('Uses email as the unique key'), clarifies what changes are made (adding/updating subscriber data), and specifies an important limitation ('Will not change subscription status of existing members'). This provides good transparency about how the tool operates, though it could mention potential side effects like email notifications or rate limits.

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 extremely concise and front-loaded, consisting of just two sentences that efficiently convey the core purpose, key mechanism, and critical limitation. Every word earns its place with no redundant information or unnecessary elaboration.

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

Completeness4/5

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

For a mutation tool with no annotations and no output schema, the description does well by explaining the upsert behavior and subscription status limitation. It provides enough context for basic usage, though it could benefit from mentioning what happens on success/failure or typical response structure. Given the 100% schema coverage for parameters, the description focuses appropriately on behavioral aspects rather than repeating parameter documentation.

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?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds minimal parameter-specific information beyond implying that 'email' is used as the unique key for upsert operations. This meets the baseline expectation when schema coverage is high, but doesn't provide additional semantic context about parameter interactions or usage examples.

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

Purpose5/5

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

The description clearly states the specific action ('Add a new subscriber or update an existing one'), the resource ('in a Mailchimp audience'), and the unique key mechanism ('Uses email as the unique key (upsert)'). It distinguishes itself from sibling tools like 'batch_add_members' by focusing on individual member operations rather than batch processing.

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool ('Add a new subscriber or update an existing one') and includes an important behavioral constraint ('Will not change subscription status of existing members'), which helps differentiate it from potential alternatives. However, it does not explicitly mention when not to use it or name specific sibling alternatives beyond the implied distinction with 'batch_add_members'.

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/dazanza/mailchimp-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server