Skip to main content
Glama
dazanza
by dazanza

set_campaign_content

Set HTML or plain-text content for Mailchimp campaigns using custom HTML or template IDs to define email content.

Instructions

Set the HTML/plain-text content for a campaign. Provide either html for custom content or template_id to use a Mailchimp template.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
campaign_idYesCampaign ID
htmlNoFull HTML content for the email
plain_textNoPlain text version of the email
template_idNoMailchimp template ID to use instead of raw HTML

Implementation Reference

  • The set_campaign_content tool is registered and implemented in server.js, handling input validation for campaign content and interaction with the Mailchimp campaigns API.
    server.tool(
      "set_campaign_content",
      "Set the HTML/plain-text content for a campaign. Provide either html for custom content or template_id to use a Mailchimp template.",
      {
        campaign_id: z.string().describe("Campaign ID"),
        html: z.string().optional().describe("Full HTML content for the email"),
        plain_text: z.string().optional().describe("Plain text version of the email"),
        template_id: z.number().optional().describe("Mailchimp template ID to use instead of raw HTML"),
      },
      async ({ campaign_id, html, plain_text, template_id }) => {
        if (!html && !template_id) {
          return {
            content: [{ type: "text", text: JSON.stringify({ error: "Must provide either 'html' or 'template_id'" }, null, 2) }],
            isError: true,
          };
        }
        const body = {};
        if (html && template_id) {
          // html and template_id are mutually exclusive in Mailchimp API.
          // When both are sent, Mailchimp silently ignores html and uses the template.
          // Prefer html (the explicit content) and warn.
          body.html = html;
          if (plain_text) body.plain_text = plain_text;
          const response = await mailchimp.campaigns.setContent(campaign_id, body);
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify({
                  success: true,
                  warning: "Both html and template_id were provided. Used html only — Mailchimp ignores html when template is also set.",
                  has_html: !!response.html,
                  has_plain_text: !!response.plain_text,
                }, null, 2),
              },
            ],
          };
        }
        if (template_id) {
          body.template = { id: template_id };
        }
        if (html) {
          body.html = html;
        }
        if (plain_text) {
          body.plain_text = plain_text;
        }
        const response = await mailchimp.campaigns.setContent(campaign_id, body);
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify({ success: true, has_html: !!response.html, has_plain_text: !!response.plain_text }, null, 2),
            },
          ],
        };
      }
    );
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It states the action ('Set') but doesn't disclose behavioral traits such as required permissions, whether changes are reversible, rate limits, or what happens to existing content. This is inadequate for a mutation tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the purpose and key usage note. Every word earns its place, with no waste or redundancy, making it highly concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a mutation tool with no annotations and no output schema, the description is incomplete. It lacks details on behavioral aspects like permissions, side effects, and response format, which are crucial for safe and effective use. The description should do more to compensate for the missing structured data.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters. The description adds marginal value by clarifying the choice between 'html' and 'template_id', but it doesn't provide additional syntax or format details beyond what the schema offers. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Set') and resource ('HTML/plain-text content for a campaign'), making the purpose specific and understandable. However, it doesn't explicitly differentiate from sibling tools like 'create_campaign' or 'get_campaign_content', which would require more context about when to use each.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage by mentioning alternatives ('either html for custom content or template_id to use a Mailchimp template'), but it doesn't explicitly state when to use this tool versus others like 'create_campaign' or 'schedule_campaign'. No exclusions or prerequisites are provided, leaving gaps in guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/dazanza/mailchimp-mcp'

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