get_campaign_report
Retrieve performance metrics for sent email campaigns including opens, clicks, bounces, and unsubscribes to analyze marketing effectiveness.
Instructions
Get performance report for a sent campaign — opens, clicks, bounces, unsubscribes, and more.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| campaign_id | Yes |
Implementation Reference
- mcp_mailchimp/server.py:298-324 (handler)The handler function `get_campaign_report` for retrieving campaign performance statistics using the Mailchimp API. It is decorated with `@mcp.tool()` for MCP registration.
@mcp.tool() async def get_campaign_report(campaign_id: str) -> str: """Get performance report for a sent campaign — opens, clicks, bounces, unsubscribes, and more.""" mc = get_client() r = await mc.get(f"/reports/{campaign_id}") return _fmt({ "campaign_id": campaign_id, "subject_line": r.get("subject_line", ""), "emails_sent": r.get("emails_sent", 0), "opens": { "total": r.get("opens", {}).get("opens_total", 0), "unique": r.get("opens", {}).get("unique_opens", 0), "rate": r.get("opens", {}).get("open_rate", 0), }, "clicks": { "total": r.get("clicks", {}).get("clicks_total", 0), "unique": r.get("clicks", {}).get("unique_clicks", 0), "rate": r.get("clicks", {}).get("click_rate", 0), }, "bounces": { "hard": r.get("bounces", {}).get("hard_bounces", 0), "soft": r.get("bounces", {}).get("soft_bounces", 0), }, "unsubscribes": r.get("unsubscribed", 0), "abuse_reports": r.get("abuse_reports", 0), "send_time": r.get("send_time", ""), })