ping
Validate Mailchimp API credentials and retrieve account details including name, email, and subscriber count.
Instructions
Validate your Mailchimp API key and get account info (name, email, total subscribers).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- mcp_mailchimp/server.py:49-66 (handler)The 'ping' tool is defined as an asynchronous function decorated with @mcp.tool(). It validates the Mailchimp API key by making a request to the '/ping' endpoint and returns formatted account information.
@mcp.tool() async def ping() -> str: """Validate your Mailchimp API key and get account info (name, email, total subscribers).""" mc = get_client() try: await mc.get("/ping") root = await mc.get("/") return _fmt({ "status": "connected", "account_name": root.get("account_name", ""), "email": root.get("email", ""), "account_id": root.get("account_id", ""), "total_subscribers": root.get("total_subscribers", 0), "data_center": mc.dc, }) except MailchimpError as e: return f"Connection failed: {e}"