Skip to main content
Glama

create_segment

Create static segments in Mailchimp by providing a list of email addresses to organize subscribers for targeted email campaigns.

Instructions

Create a static segment from email addresses. emails: comma-separated list.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
list_idYes
nameYes
emailsNo

Implementation Reference

  • Implementation of the create_segment tool handler, which creates a static segment in Mailchimp.
    @mcp.tool()
    async def create_segment(
        list_id: str,
        name: str,
        emails: str = "",
    ) -> str:
        """Create a static segment from email addresses. emails: comma-separated list."""
        mc = get_client()
        body: dict[str, Any] = {"name": name}
        if emails:
            body["static_segment"] = [e.strip() for e in emails.split(",") if e.strip()]
        s = await mc.post(f"/lists/{list_id}/segments", json=body)
        return _fmt({
            "id": s.get("id", ""),
            "name": s.get("name", ""),
            "member_count": s.get("member_count", 0),
            "message": "Segment created.",
        })

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/AlexlaGuardia/mcp-mailchimp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server