Automate Klaviyo tasks via Rube MCP (Composio): manage email/SMS campaigns, inspect campaign messages, track tags, and monitor send jobs. Always search tools first for current schemas.
Add this skill
npx mdskills install sickn33/klaviyo-automationComprehensive Klaviyo automation with detailed workflows, pagination handling, and API quirks documented
1---2name: klaviyo-automation3description: "Automate Klaviyo tasks via Rube MCP (Composio): manage email/SMS campaigns, inspect campaign messages, track tags, and monitor send jobs. Always search tools first for current schemas."4requires:5 mcp: [rube]6---78# Klaviyo Automation via Rube MCP910Automate Klaviyo email and SMS marketing operations through Composio's Klaviyo toolkit via Rube MCP.1112## Prerequisites1314- Rube MCP must be connected (RUBE_SEARCH_TOOLS available)15- Active Klaviyo connection via `RUBE_MANAGE_CONNECTIONS` with toolkit `klaviyo`16- Always call `RUBE_SEARCH_TOOLS` first to get current tool schemas1718## Setup1920**Get Rube MCP**: Add `https://rube.app/mcp` as an MCP server in your client configuration. No API keys needed — just add the endpoint and it works.2122231. Verify Rube MCP is available by confirming `RUBE_SEARCH_TOOLS` responds242. Call `RUBE_MANAGE_CONNECTIONS` with toolkit `klaviyo`253. If connection is not ACTIVE, follow the returned auth link to complete Klaviyo authentication264. Confirm connection status shows ACTIVE before running any workflows2728## Core Workflows2930### 1. List and Filter Campaigns3132**When to use**: User wants to browse, search, or filter marketing campaigns3334**Tool sequence**:351. `KLAVIYO_GET_CAMPAIGNS` - List campaigns with channel and status filters [Required]3637**Key parameters**:38- `channel`: Campaign channel - 'email' or 'sms' (required by Klaviyo API)39- `filter`: Additional filter string (e.g., `equals(status,"draft")`)40- `sort`: Sort field with optional `-` prefix for descending (e.g., '-created_at', 'name')41- `page_cursor`: Pagination cursor for next page42- `include_archived`: Include archived campaigns (default: false)4344**Pitfalls**:45- `channel` is required; omitting it can produce incomplete or unexpected results46- Pagination is mandatory for full coverage; a single call returns only one page (default ~10)47- Follow `page_cursor` until exhausted to get all campaigns48- Status filtering via `filter` (e.g., `equals(status,"draft")`) can return mixed statuses; always validate `data[].attributes.status` client-side49- Status strings are case-sensitive and can be compound (e.g., 'Cancelled: No Recipients')50- Response shape is nested: `response.data.data` with status at `data[].attributes.status`5152### 2. Get Campaign Details5354**When to use**: User wants detailed information about a specific campaign5556**Tool sequence**:571. `KLAVIYO_GET_CAMPAIGNS` - Find campaign to get its ID [Prerequisite]582. `KLAVIYO_GET_CAMPAIGN` - Retrieve full campaign details [Required]5960**Key parameters**:61- `campaign_id`: Campaign ID string (e.g., '01GDDKASAP8TKDDA2GRZDSVP4H')62- `include_messages`: Include campaign messages in response63- `include_tags`: Include tags in response6465**Pitfalls**:66- Campaign IDs are alphanumeric strings, not numeric67- `include_messages` and `include_tags` add related data to the response via Klaviyo's include mechanism68- Campaign details include audiences, send strategy, tracking options, and scheduling info6970### 3. Inspect Campaign Messages7172**When to use**: User wants to view the email/SMS content of a campaign7374**Tool sequence**:751. `KLAVIYO_GET_CAMPAIGN` - Find campaign and its message IDs [Prerequisite]762. `KLAVIYO_GET_CAMPAIGN_MESSAGE` - Get message content details [Required]7778**Key parameters**:79- `id`: Message ID string80- `fields__campaign__message`: Sparse fieldset for message attributes (e.g., 'content.subject', 'content.from_email', 'content.body')81- `fields__campaign`: Sparse fieldset for campaign attributes82- `fields__template`: Sparse fieldset for template attributes83- `include`: Related resources to include ('campaign', 'template')8485**Pitfalls**:86- Message IDs are separate from campaign IDs; extract from campaign response87- Sparse fieldset syntax uses dot notation for nested fields: 'content.subject', 'content.from_email'88- Email messages have content fields: subject, preview_text, from_email, from_label, reply_to_email89- SMS messages have content fields: body90- Including 'template' provides the HTML/text content of the email9192### 4. Manage Campaign Tags9394**When to use**: User wants to view tags associated with campaigns for organization9596**Tool sequence**:971. `KLAVIYO_GET_CAMPAIGN_RELATIONSHIPS_TAGS` - Get tag IDs for a campaign [Required]9899**Key parameters**:100- `id`: Campaign ID string101102**Pitfalls**:103- Returns only tag IDs, not tag names/details104- Tag IDs can be used with Klaviyo's tag endpoints for full details105- Rate limit: 3/s burst, 60/m steady (stricter than other endpoints)106107### 5. Monitor Campaign Send Jobs108109**When to use**: User wants to check the status of a campaign send operation110111**Tool sequence**:1121. `KLAVIYO_GET_CAMPAIGN_SEND_JOB` - Check send job status [Required]113114**Key parameters**:115- `id`: Send job ID116117**Pitfalls**:118- Send job IDs are returned when a campaign send is initiated119- Job statuses indicate whether the send is queued, in progress, complete, or failed120- Rate limit: 10/s burst, 150/m steady121122## Common Patterns123124### Campaign Discovery Pattern125126```1271. Call KLAVIYO_GET_CAMPAIGNS with channel='email'1282. Paginate through all results via page_cursor1293. Filter by status client-side for accuracy1304. Extract campaign IDs for detailed inspection131```132133### Sparse Fieldset Pattern134135Klaviyo supports sparse fieldsets to reduce response size:136```137fields__campaign__message=['content.subject', 'content.from_email', 'send_times']138fields__campaign=['name', 'status', 'send_time']139fields__template=['name', 'html', 'text']140```141142### Pagination143144- Klaviyo uses cursor-based pagination145- Check response for `page_cursor` in the pagination metadata146- Pass cursor as `page_cursor` in next request147- Default page size is ~10 campaigns148- Continue until no more cursor is returned149150### Filter Syntax151152```153- equals(status,"draft") - Campaigns in draft status154- equals(name,"Newsletter") - Campaign named "Newsletter"155- greater-than(created_at,"2024-01-01T00:00:00Z") - Created after date156```157158## Known Pitfalls159160**API Version**:161- Klaviyo API uses versioned endpoints (e.g., v2024-07-15)162- Response schemas may change between API versions163- Tool responses follow the version configured in the Composio integration164165**Response Nesting**:166- Data is nested: `response.data.data[].attributes`167- Campaign status at `data[].attributes.status`168- Mis-parsing the nesting yields empty or incorrect results169- Always navigate through the full path defensively170171**Rate Limits**:172- Burst: 10/s (3/s for tag endpoints)173- Steady: 150/m (60/m for tag endpoints)174- Required scope: campaigns:read175- Implement backoff on 429 responses176177**Status Values**:178- Status strings are case-sensitive179- Compound statuses exist (e.g., 'Cancelled: No Recipients')180- Server-side filtering may return mixed statuses; always validate client-side181182## Quick Reference183184| Task | Tool Slug | Key Params |185|------|-----------|------------|186| List campaigns | KLAVIYO_GET_CAMPAIGNS | channel, filter, sort, page_cursor |187| Get campaign details | KLAVIYO_GET_CAMPAIGN | campaign_id, include_messages, include_tags |188| Get campaign message | KLAVIYO_GET_CAMPAIGN_MESSAGE | id, fields__campaign__message |189| Get campaign tags | KLAVIYO_GET_CAMPAIGN_RELATIONSHIPS_TAGS | id |190| Get send job status | KLAVIYO_GET_CAMPAIGN_SEND_JOB | id |191
Full transparency — inspect the skill content before installing.