search_members
Search for Mailchimp members by email or name across audiences to locate subscribers and manage contacts.
Instructions
Search for members by email or name across all audiences (or a specific one).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| list_id | No |
Implementation Reference
- mcp_mailchimp/server.py:556-575 (handler)The handler function 'search_members' implements the search functionality by calling the Mailchimp API '/search-members' endpoint and formatting the results. It is decorated with @mcp.tool().
@mcp.tool() async def search_members(query: str, list_id: str = "") -> str: """Search for members by email or name across all audiences (or a specific one).""" mc = get_client() params: dict[str, str] = {"query": query} if list_id: params["list_id"] = list_id data = await mc.get("/search-members", params=params) results = [] for match in data.get("exact_matches", {}).get("members", []): results.append({ "email": match.get("email_address", ""), "full_name": match.get("full_name", ""), "status": match.get("status", ""), "list_id": match.get("list_id", ""), }) for match in data.get("full_search", {}).get("members", []): email = match.get("email_address", "") if not any(r["email"] == email for r in results): results.append({