klaviyo-automation
通过Rube MCP(Composio)实现Klaviyo任务自动化:管理邮件/短信营销活动,检查活动消息,追踪标签,并监控发送任务。始终优先搜索工具以获取当前架构信息。
Klaviyo Automation via Rube MCP
Automate Klaviyo email and SMS marketing operations through Composio's Klaviyo toolkit via Rube MCP.
Prerequisites
RUBE_MANAGE_CONNECTIONS with toolkit klaviyoRUBE_SEARCH_TOOLS first to get current tool schemasSetup
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.
RUBE_SEARCH_TOOLS respondsRUBE_MANAGE_CONNECTIONS with toolkit klaviyoCore Workflows
1. List and Filter Campaigns
When to use: User wants to browse, search, or filter marketing campaigns
Tool sequence:
KLAVIYO_GET_CAMPAIGNS - List campaigns with channel and status filters [Required]Key parameters:
channel: Campaign channel - 'email' or 'sms' (required by Klaviyo API)filter: Additional filter string (e.g., equals(status,"draft"))sort: Sort field with optional - prefix for descending (e.g., '-created_at', 'name')page_cursor: Pagination cursor for next pageinclude_archived: Include archived campaigns (default: false)Pitfalls:
channel is required; omitting it can produce incomplete or unexpected resultspage_cursor until exhausted to get all campaignsfilter (e.g., equals(status,"draft")) can return mixed statuses; always validate data[].attributes.status client-sideresponse.data.data with status at data[].attributes.status2. Get Campaign Details
When to use: User wants detailed information about a specific campaign
Tool sequence:
KLAVIYO_GET_CAMPAIGNS - Find campaign to get its ID [Prerequisite]KLAVIYO_GET_CAMPAIGN - Retrieve full campaign details [Required]Key parameters:
campaign_id: Campaign ID string (e.g., '01GDDKASAP8TKDDA2GRZDSVP4H')include_messages: Include campaign messages in responseinclude_tags: Include tags in responsePitfalls:
include_messages and include_tags add related data to the response via Klaviyo's include mechanism3. Inspect Campaign Messages
When to use: User wants to view the email/SMS content of a campaign
Tool sequence:
KLAVIYO_GET_CAMPAIGN - Find campaign and its message IDs [Prerequisite]KLAVIYO_GET_CAMPAIGN_MESSAGE - Get message content details [Required]Key parameters:
id: Message ID stringfields__campaign__message: Sparse fieldset for message attributes (e.g., 'content.subject', 'content.from_email', 'content.body')fields__campaign: Sparse fieldset for campaign attributesfields__template: Sparse fieldset for template attributesinclude: Related resources to include ('campaign', 'template')Pitfalls:
4. Manage Campaign Tags
When to use: User wants to view tags associated with campaigns for organization
Tool sequence:
KLAVIYO_GET_CAMPAIGN_RELATIONSHIPS_TAGS - Get tag IDs for a campaign [Required]Key parameters:
id: Campaign ID stringPitfalls:
5. Monitor Campaign Send Jobs
When to use: User wants to check the status of a campaign send operation
Tool sequence:
KLAVIYO_GET_CAMPAIGN_SEND_JOB - Check send job status [Required]Key parameters:
id: Send job IDPitfalls:
Common Patterns
Campaign Discovery Pattern
1. Call KLAVIYO_GET_CAMPAIGNS with channel='email'
Paginate through all results via page_cursor
Filter by status client-side for accuracy
Extract campaign IDs for detailed inspection Sparse Fieldset Pattern
Klaviyo supports sparse fieldsets to reduce response size:
fields__campaign__message=['content.subject', 'content.from_email', 'send_times']
fields__campaign=['name', 'status', 'send_time']
fields__template=['name', 'html', 'text']Pagination
page_cursor in the pagination metadatapage_cursor in next requestFilter Syntax
- equals(status,"draft") - Campaigns in draft status
equals(name,"Newsletter") - Campaign named "Newsletter"
greater-than(created_at,"2024-01-01T00:00:00Z") - Created after date Known Pitfalls
API Version:
Response Nesting:
response.data.data[].attributesdata[].attributes.statusRate Limits:
Status Values:
Quick Reference
| Task | Tool Slug | Key Params |
|---|---|---|
| List campaigns | KLAVIYO_GET_CAMPAIGNS | channel, filter, sort, page_cursor |
| Get campaign details | KLAVIYO_GET_CAMPAIGN | campaign_id, include_messages, include_tags |
| Get campaign message | KLAVIYO_GET_CAMPAIGN_MESSAGE | id, fields__campaign__message |
| Get campaign tags | KLAVIYO_GET_CAMPAIGN_RELATIONSHIPS_TAGS | id |
| Get send job status | KLAVIYO_GET_CAMPAIGN_SEND_JOB | id |