Skip to main content
Glama

create_campaign

Create a new email campaign for your Mailchimp audience. Specify campaign type (regular, plaintext, A/B split, or RSS), subject line, sender details, and audience list to generate a campaign ID for further management.

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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The `create_campaign` tool handler function. It is an async function decorated with @mcp.tool() that takes list_id, subject_line, from_name, reply_to (required), plus optional title, preview_text, and campaign_type. It builds the request body and posts to the Mailchimp /campaigns endpoint, returning the new campaign ID, status, and title.
    @mcp.tool()
    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.",
        })
  • The FastMCP server instance (`mcp`) used to register tools via the @mcp.tool() decorator. The `create_campaign` function is registered this way on line 133.
    mcp = FastMCP(
        "mcp-mailchimp",
        instructions=(
            "Production-grade MCP server for the Mailchimp Marketing API. "
            "71 tools for campaigns, audiences, members, tags, segments, "
            "templates, reports, automations, webhooks, merge fields, "
            "interest groups, landing pages, batch operations, e-commerce, "
            "A/B testing, member notes, file manager, and audience analytics."
        ),
    )
  • The function signature and docstring act as the input schema — the parameter names, types, defaults, and descriptions define what inputs the tool accepts (list_id, subject_line, from_name, reply_to, title, preview_text, campaign_type).
    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:
Behavior2/5

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

With no annotations, the description should disclose side effects, prerequisites, and return behavior beyond returning an ID. It does not mention that the campaign is created as a draft, any required permissions, 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.

Conciseness3/5

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

The description is very short and front-loaded with the action, but it omits critical details. It is concise but at the expense of completeness.

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

Completeness2/5

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

Given the tool's complexity (7 parameters, 4 required) and absence of annotations, the description fails to provide sufficient context about inputs, output, or behavior. An output schema exists but is not referenced.

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

Parameters2/5

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

Schema coverage is 0%, and the description only mentions campaign_type options. No explanation is given for required parameters like list_id, subject_line, from_name, or reply_to, which are essential for usage.

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 tool creates a new email campaign and lists possible campaign types, distinguishing it from sibling tools like cancel or replicate.

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?

No guidance is given on when to use this tool vs alternatives such as replicate_campaign or schedule_campaign. The description lacks explicit context for choosing this tool.

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