get_member
Retrieve subscriber details from a Mailchimp audience using their email address and list ID.
Instructions
Get details for a specific subscriber by email address.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| list_id | Yes | ||
| Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- mcp_mailchimp/server.py:489-512 (handler)The get_member tool handler: retrieves details for a specific subscriber by email address. It hashes the email via mc.subscriber_hash(email), calls the Mailchimp API at /lists/{list_id}/members/{hash}, and returns a formatted response with email, status, full_name, merge fields, rating, tags, VIP status, source, IP, language, location, subscription timestamp, and last changed date.
@mcp.tool() async def get_member(list_id: str, email: str) -> str: """Get details for a specific subscriber by email address.""" mc = get_client() h = mc.subscriber_hash(email) m = await mc.get(f"/lists/{list_id}/members/{h}") merge = m.get("merge_fields", {}) return _fmt({ "email": m.get("email_address", ""), "status": m.get("status", ""), "full_name": m.get("full_name", ""), "first_name": merge.get("FNAME", ""), "last_name": merge.get("LNAME", ""), "rating": m.get("member_rating", 0), "tags_count": m.get("tags_count", 0), "vip": m.get("vip", False), "source": m.get("source", ""), "ip_signup": m.get("ip_signup", ""), "language": m.get("language", ""), "location": m.get("location", {}), "subscribed_at": m.get("timestamp_opt", ""), "last_changed": m.get("last_changed", ""), "id": m.get("id", ""), }) - mcp_mailchimp/server.py:489-512 (registration)The tool is registered via the @mcp.tool() decorator on the get_member async function, making it available as an MCP tool named 'get_member' through the FastMCP framework.
@mcp.tool() async def get_member(list_id: str, email: str) -> str: """Get details for a specific subscriber by email address.""" mc = get_client() h = mc.subscriber_hash(email) m = await mc.get(f"/lists/{list_id}/members/{h}") merge = m.get("merge_fields", {}) return _fmt({ "email": m.get("email_address", ""), "status": m.get("status", ""), "full_name": m.get("full_name", ""), "first_name": merge.get("FNAME", ""), "last_name": merge.get("LNAME", ""), "rating": m.get("member_rating", 0), "tags_count": m.get("tags_count", 0), "vip": m.get("vip", False), "source": m.get("source", ""), "ip_signup": m.get("ip_signup", ""), "language": m.get("language", ""), "location": m.get("location", {}), "subscribed_at": m.get("timestamp_opt", ""), "last_changed": m.get("last_changed", ""), "id": m.get("id", ""), }) - mcp_mailchimp/client.py:37-40 (helper)The subscriber_hash helper method used by get_member: it computes the MD5 hash of the lowercase, trimmed email address, which is how Mailchimp identifies subscribers in API endpoints.
@staticmethod def subscriber_hash(email: str) -> str: """MD5 hash of lowercase email — Mailchimp's subscriber identifier.""" return hashlib.md5(email.lower().strip().encode()).hexdigest() - mcp_mailchimp/server.py:41-43 (helper)The _fmt helper function used by get_member to format the response as indented JSON.
def _fmt(data: Any) -> str: """Format response data as indented JSON string.""" return json.dumps(data, indent=2, default=str)