get_campaign_content
Retrieve HTML and plain-text content from a Mailchimp campaign to review, edit, or analyze email marketing materials.
Instructions
Get the current HTML and plain-text content of a campaign.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| campaign_id | Yes | Campaign ID |
Implementation Reference
- server.js:225-242 (handler)The handler function for 'get_campaign_content' which calls the Mailchimp API and returns the campaign content.
async ({ campaign_id }) => { const response = await mailchimp.campaigns.getContent(campaign_id); return { content: [ { type: "text", text: JSON.stringify( { html: response.html?.substring(0, 5000) + (response.html?.length > 5000 ? "...[truncated]" : ""), plain_text: response.plain_text?.substring(0, 2000), archive_html: response.archive_html, }, null, 2 ), }, ], }; - server.js:219-224 (registration)Registration of the 'get_campaign_content' tool.
server.tool( "get_campaign_content", "Get the current HTML and plain-text content of a campaign.", { campaign_id: z.string().describe("Campaign ID"), },