Skip to main content
Glama

set_campaign_content

Set or update content for Mailchimp email campaigns using custom HTML, plain text, or predefined templates to deliver marketing messages.

Instructions

Set campaign content. Provide html for custom content, or template_id to use a template.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
campaign_idYes
htmlNo
plain_textNo
template_idNo

Implementation Reference

  • The set_campaign_content tool definition and implementation, registered with the FastMCP decorator. It takes a campaign_id and either HTML/plain text content or a template_id to update the campaign's content via a PUT request to the Mailchimp API.
    async def set_campaign_content(
        campaign_id: str,
        html: str = "",
        plain_text: str = "",
        template_id: int = 0,
    ) -> str:
        """Set campaign content. Provide html for custom content, or template_id to use a template."""
        mc = get_client()
        body: dict[str, Any] = {}
        if html:
            body["html"] = html
        if plain_text:
            body["plain_text"] = plain_text
        if template_id:
            body["template"] = {"id": template_id}
        if not body:
            return "Provide html, plain_text, or template_id."
        await mc.put(f"/campaigns/{campaign_id}/content", json=body)
        return _fmt({
            "campaign_id": campaign_id,
            "content_type": "template" if template_id else "custom_html",
            "message": "Campaign content set.",
        })

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