get_member_activity
Retrieve subscriber activity data including opens, clicks, and bounces from Mailchimp to analyze engagement patterns and campaign performance.
Instructions
Get recent activity for a subscriber — opens, clicks, bounces, etc.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| list_id | Yes | ||
| Yes | |||
| count | No |
Implementation Reference
- mcp_mailchimp/server.py:584-601 (handler)The implementation of the 'get_member_activity' tool in mcp_mailchimp/server.py. It retrieves activity-feed data for a specific subscriber from Mailchimp and returns it as a formatted string.
@mcp.tool() async def get_member_activity(list_id: str, email: str, count: int = 20) -> str: """Get recent activity for a subscriber — opens, clicks, bounces, etc.""" mc = get_client() h = mc.subscriber_hash(email) data = await mc.get( f"/lists/{list_id}/members/{h}/activity-feed", params={"count": min(count, 50)}, ) activities = [] for a in data.get("activity", []): activities.append({ "action": a.get("action", ""), "title": a.get("title", ""), "timestamp": a.get("timestamp", ""), "campaign_id": a.get("campaign_id", ""), }) return _fmt({"email": email, "activities": activities})