archive_member
Remove a subscriber from a Mailchimp audience by archiving their profile, preserving data for future re-addition via add_or_update_member.
Instructions
Archive (soft-delete) a subscriber. They can be re-added later via add_or_update_member.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| list_id | Yes | ||
| Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- mcp_mailchimp/server.py:549-555 (handler)The actual implementation of the archive_member tool. It takes list_id and email, hashes the email via mc.subscriber_hash(), sends a DELETE request to Mailchimp's members endpoint, and returns a confirmation message.
@mcp.tool() async def archive_member(list_id: str, email: str) -> str: """Archive (soft-delete) a subscriber. They can be re-added later via add_or_update_member.""" mc = get_client() h = mc.subscriber_hash(email) await mc.delete(f"/lists/{list_id}/members/{h}") return _fmt({"email": email, "message": "Member archived."}) - mcp_mailchimp/server.py:549-555 (registration)The tool is registered via the @mcp.tool() decorator on line 549, making it available as 'archive_member' in the MCP server.
@mcp.tool() async def archive_member(list_id: str, email: str) -> str: """Archive (soft-delete) a subscriber. They can be re-added later via add_or_update_member.""" mc = get_client() h = mc.subscriber_hash(email) await mc.delete(f"/lists/{list_id}/members/{h}") return _fmt({"email": email, "message": "Member archived."}) - mcp_mailchimp/server.py:549-551 (schema)Input schema is implicitly defined by the function signature parameters (list_id: str, email: str) and the docstring 'Archive (soft-delete) a subscriber. They can be re-added later via add_or_update_member.'
@mcp.tool() async def archive_member(list_id: str, email: str) -> str: """Archive (soft-delete) a subscriber. They can be re-added later via add_or_update_member.""" - mcp_mailchimp/client.py:37-40 (helper)The subscriber_hash() static method used by archive_member to MD5-hash the email address for Mailchimp's API.
@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/client.py:70-71 (helper)The delete() HTTP method on MailchimpClient, called by archive_member to DELETE the member.
async def delete(self, path: str) -> Any: return await self._request("DELETE", path)