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
| Name | Required | Description | Default |
|---|---|---|---|
| campaign_id | Yes | ||
| html | No | ||
| plain_text | No | ||
| template_id | No |
Implementation Reference
- mcp_mailchimp/server.py:268-290 (handler)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.", })