Skip to main content
Glama

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
NameRequiredDescriptionDefault
countNo
offsetNo

Implementation Reference

  • 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})
  • Registration of the list_audiences tool using the @mcp.tool() decorator.
    @mcp.tool()

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