Skip to main content
Glama

update_campaign

Modify existing email campaign settings in Mailchimp by updating specific fields like subject line, sender name, or preview text.

Instructions

Update campaign settings. Only provide fields you want to change.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
campaign_idYes
subject_lineNo
from_nameNo
reply_toNo
titleNo
preview_textNo

Implementation Reference

  • The update_campaign tool is defined using @mcp.tool() and handles patching campaign settings via the Mailchimp API.
    @mcp.tool()
    async def update_campaign(
        campaign_id: str,
        subject_line: str = "",
        from_name: str = "",
        reply_to: str = "",
        title: str = "",
        preview_text: str = "",
    ) -> str:
        """Update campaign settings. Only provide fields you want to change."""
        mc = get_client()
        settings: dict[str, str] = {}
        if subject_line:
            settings["subject_line"] = subject_line
        if from_name:
            settings["from_name"] = from_name
        if reply_to:
            settings["reply_to"] = reply_to
        if title:
            settings["title"] = title
        if preview_text:
            settings["preview_text"] = preview_text
        if not settings:
            return "No fields provided to update."
        c = await mc.patch(f"/campaigns/{campaign_id}", json={"settings": settings})
        return _fmt({
            "id": c["id"],
            "status": c.get("status", ""),
            "updated_fields": list(settings.keys()),
            "message": "Campaign updated.",
        })

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