list_audiences
Retrieve all mailing lists with subscriber counts and statistics to manage audience data and track growth.
Instructions
List all audiences (mailing lists) with subscriber counts and stats.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | No | ||
| offset | No |
Implementation Reference
- mcp_mailchimp/server.py:377-393 (handler)The list_audiences tool handler retrieves mailing lists from Mailchimp and formats the output.
async def list_audiences(count: int = 20, offset: int = 0) -> str: """List all audiences (mailing lists) with subscriber counts and stats.""" mc = get_client() data = await mc.get("/lists", params={"count": min(count, 100), "offset": offset}) audiences = [] for a in data.get("lists", []): stats = a.get("stats", {}) audiences.append({ "id": a["id"], "name": a.get("name", ""), "member_count": stats.get("member_count", 0), "unsubscribe_count": stats.get("unsubscribe_count", 0), "open_rate": stats.get("open_rate", 0), "click_rate": stats.get("click_rate", 0), "created_at": a.get("date_created", ""), }) return _fmt({"total_items": data.get("total_items", 0), "audiences": audiences}) - mcp_mailchimp/server.py:376-376 (registration)Registration of the list_audiences tool using the @mcp.tool() decorator.
@mcp.tool()