list_automation_emails
Retrieve all emails in a Mailchimp automation workflow, including their status, delay, and position, to track campaign progress and optimize scheduling.
Instructions
List all emails in an automation workflow with their status, delay, and position.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workflow_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- mcp_mailchimp/server.py:834-852 (handler)The `list_automation_emails` tool handler function. It is decorated with @mcp.tool(), takes a workflow_id parameter, calls the Mailchimp API at /automations/{workflow_id}/emails, and returns a formatted JSON response listing all emails in an automation workflow with status, delay, and position.
@mcp.tool() async def list_automation_emails(workflow_id: str) -> str: """List all emails in an automation workflow with their status, delay, and position.""" mc = get_client() data = await mc.get(f"/automations/{workflow_id}/emails") emails = [] for e in data.get("emails", []): s = e.get("settings", {}) emails.append({ "id": e.get("id", ""), "position": e.get("position", 0), "status": e.get("status", ""), "subject_line": s.get("subject_line", ""), "from_name": s.get("from_name", ""), "delay": e.get("delay", {}), "emails_sent": e.get("emails_sent", 0), "send_time": e.get("send_time", ""), }) return _fmt({"workflow_id": workflow_id, "total_emails": len(emails), "emails": emails}) - mcp_mailchimp/server.py:834-835 (registration)The tool is registered via the @mcp.tool() decorator on the `list_automation_emails` async function in the FastMCP server instance.
@mcp.tool() async def list_automation_emails(workflow_id: str) -> str: