Skip to main content
Glama

create_campaign

Create email campaigns in Mailchimp by specifying recipients, subject line, sender details, and campaign type to send marketing communications.

Instructions

Create a new email campaign. Returns the campaign ID. Type: regular, plaintext, absplit, rss.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
list_idYes
subject_lineYes
from_nameYes
reply_toYes
titleNo
preview_textNo
campaign_typeNoregular

Implementation Reference

  • The implementation of the create_campaign tool, which handles the request to create a new email campaign in Mailchimp.
    async def create_campaign(
        list_id: str,
        subject_line: str,
        from_name: str,
        reply_to: str,
        title: str = "",
        preview_text: str = "",
        campaign_type: str = "regular",
    ) -> str:
        """Create a new email campaign. Returns the campaign ID. Type: regular, plaintext, absplit, rss."""
        mc = get_client()
        body: dict[str, Any] = {
            "type": campaign_type,
            "recipients": {"list_id": list_id},
            "settings": {
                "subject_line": subject_line,
                "from_name": from_name,
                "reply_to": reply_to,
                "title": title or subject_line,
            },
        }
        if preview_text:
            body["settings"]["preview_text"] = preview_text
        c = await mc.post("/campaigns", json=body)
        return _fmt({
            "id": c["id"],
            "status": c.get("status", ""),
            "title": c.get("settings", {}).get("title", ""),
            "message": "Campaign created successfully.",
        })

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