Skip to main content
Glama

add_or_update_member

Add or update a subscriber in a Mailchimp list using upsert logic. Provide email, status (subscribed, pending, unsubscribed), name, and comma-separated tags. Automatically handles new or existing members.

Instructions

Add a new subscriber or update if exists (upsert). Status: subscribed, pending, unsubscribed. Tags: comma-separated.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
list_idYes
emailYes
statusNosubscribed
first_nameNo
last_nameNo
tagsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The 'add_or_update_member' tool handler function. Registered via @mcp.tool() decorator, it adds a new subscriber or updates an existing one (upsert) using Mailchimp's PUT /lists/{list_id}/members/{subscriber_hash} endpoint. Accepts list_id, email, status (default 'subscribed'), first_name, last_name, and comma-separated tags. Computes the MD5 subscriber hash using MailchimpClient.subscriber_hash.
    @mcp.tool()
    async def add_or_update_member(
        list_id: str,
        email: str,
        status: str = "subscribed",
        first_name: str = "",
        last_name: str = "",
        tags: str = "",
    ) -> str:
        """Add a new subscriber or update if exists (upsert). Status: subscribed, pending, unsubscribed. Tags: comma-separated."""
        mc = get_client()
        h = mc.subscriber_hash(email)
        body: dict[str, Any] = {
            "email_address": email.lower().strip(),
            "status_if_new": status,
        }
        merge_fields: dict[str, str] = {}
        if first_name:
            merge_fields["FNAME"] = first_name
        if last_name:
            merge_fields["LNAME"] = last_name
        if merge_fields:
            body["merge_fields"] = merge_fields
        if tags:
            body["tags"] = [t.strip() for t in tags.split(",") if t.strip()]
        m = await mc.put(f"/lists/{list_id}/members/{h}", json=body)
        return _fmt({
            "email": m.get("email_address", ""),
            "status": m.get("status", ""),
            "id": m.get("id", ""),
            "message": "Member added/updated.",
        })
  • Registration of the 'add_or_update_member' tool via the @mcp.tool() decorator on line 515.
    async def add_or_update_member(
  • The 'archive_member' tool references add_or_update_member in its docstring: 'They can be re-added later via add_or_update_member.'
    @mcp.tool()
    async def archive_member(list_id: str, email: str) -> str:
        """Archive (soft-delete) a subscriber. They can be re-added later via add_or_update_member."""
        mc = get_client()
        h = mc.subscriber_hash(email)
        await mc.delete(f"/lists/{list_id}/members/{h}")
        return _fmt({"email": email, "message": "Member archived."})
Behavior2/5

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

No annotations are available, so the description carries the burden. It mentions upsert but does not clarify partial update behavior, idempotency, or what happens to unspecified fields. More detail on update behavior would help.

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—two sentences that deliver the core purpose and key parameter details without repetition. Every word earns its place.

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 six parameters and no annotations, the description covers the main action but omits details like required parameters, return value, or potential errors. It is minimally adequate but not fully comprehensive.

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 0%, so the description must compensate. It adds value for status (listing allowed values) and tags (format hint), but provides no additional context for list_id, email, first_name, or last_name beyond the schema titles.

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 upsert behavior ('Add a new subscriber or update if exists') and mentions key parameters like status options and tags format. It is distinct from siblings like batch_subscribe_members or add_member_note.

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

Usage Guidelines3/5

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

While the description implies single-member upserting, it does not explicitly state when to use this tool versus alternatives like batch_subscribe_members or add_member_note. No 'when not to use' guidance is provided.

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

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