Skip to main content
Glama

list_members

Retrieve audience members from Mailchimp lists with filtering options for subscription status, count, and offset to manage subscriber data.

Instructions

List members of an audience. Filter by status: subscribed, unsubscribed, cleaned, pending, transactional.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
list_idYes
statusNo
countNo
offsetNo

Implementation Reference

  • The `list_members` tool implementation, registered with `@mcp.tool()` and using the Mailchimp API client to fetch list members.
    @mcp.tool()
    async def list_members(
        list_id: str,
        status: str = "",
        count: int = 20,
        offset: int = 0,
    ) -> str:
        """List members of an audience. Filter by status: subscribed, unsubscribed, cleaned, pending, transactional."""
        mc = get_client()
        params: dict[str, Any] = {"count": min(count, 100), "offset": offset}
        if status:
            params["status"] = status
        data = await mc.get(f"/lists/{list_id}/members", params=params)
        members = []
        for m in data.get("members", []):
            members.append({
                "email": m.get("email_address", ""),
                "status": m.get("status", ""),
                "full_name": m.get("full_name", ""),
                "tags_count": m.get("tags_count", 0),
                "rating": m.get("member_rating", 0),
                "last_changed": m.get("last_changed", ""),
                "id": m.get("id", ""),
            })
        return _fmt({"total_items": data.get("total_items", 0), "members": members})

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