Skip to main content
Glama

list_templates

Retrieve available email templates from Mailchimp to reuse designs for campaigns, newsletters, or automated emails.

Instructions

List available email templates.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
countNo
offsetNo

Implementation Reference

  • The `list_templates` function is decorated with `@mcp.tool()` to register it as an MCP tool, and it handles fetching templates from the Mailchimp API.
    @mcp.tool()
    async def list_templates(count: int = 20, offset: int = 0) -> str:
        """List available email templates."""
        mc = get_client()
        data = await mc.get(
            "/templates",
            params={"count": min(count, 100), "offset": offset},
        )
        templates = []
        for t in data.get("templates", []):
            templates.append({
                "id": t.get("id", ""),
                "name": t.get("name", ""),
                "type": t.get("type", ""),
                "category": t.get("category", ""),
                "active": t.get("active", False),
                "created_at": t.get("date_created", ""),
            })
        return _fmt({"total_items": data.get("total_items", 0), "templates": templates})

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