Skip to main content
Glama

list_members

Retrieve audience members with optional status filters. Specify list ID and filter by subscribed, unsubscribed, cleaned, pending, or transactional status to get targeted member 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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The 'list_members' tool function. It accepts list_id, status, count, and offset parameters, calls the Mailchimp API at /lists/{list_id}/members, and returns formatted member data including email, status, full_name, tags_count, rating, last_changed, and id.
    @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})
  • The tool is registered with FastMCP via the @mcp.tool() decorator on line 462.
    @mcp.tool()
    async def list_members(
  • The get_client() helper function used by list_members to obtain the MailchimpClient singleton.
    def get_client() -> MailchimpClient:
        global _client
        if _client is None:
            api_key = os.environ.get("MAILCHIMP_API_KEY", "")
            if not api_key or "-" not in api_key:
                raise ValueError(
                    "MAILCHIMP_API_KEY environment variable required. "
                    "Format: xxxxxxxxxx-usXX "
                    "(get yours at https://mailchimp.com/account/api)"
                )
            _client = MailchimpClient(api_key)
        return _client
  • The _fmt() helper function used by list_members to format output as indented JSON.
    def _fmt(data: Any) -> str:
        """Format response data as indented JSON string."""
        return json.dumps(data, indent=2, default=str)
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description must fully disclose behavioral traits. It only mentions listing and filtering by status, omitting pagination behavior (count/offset), response structure, authentication requirements, or rate limits. The output schema exists but is not referenced.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise: two sentences that front-load the purpose and immediately provide key details (filter values). No unnecessary words or structures.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 4 parameters, no annotations, and an output schema, the description is incomplete. It does not explain pagination (count/offset) or hint at the response format, leaving the agent to infer behavior from parameter defaults alone.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description should add meaning to parameters. It only explains the status parameter by listing filter values. The required list_id, count, and offset parameters are not described beyond their schema names and defaults.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: listing members of an audience, with a specific verb 'List' and resource 'members of an audience'. It also mentions filtering by status with enumerated values, distinguishing it from siblings like get_member (single member) or add_member_note (modification).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for listing members with optional status filter but does not explicitly state when to use this tool versus alternatives (e.g., get_member for a single member, search_members for search). No when-not-to-use or exclusion criteria are provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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