Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion TOOLS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
- **activate_triggered_campaign** ✏️✉️: Activate a triggered campaign (requires API triggered campaign activation enabled)
- **archive_campaigns** ✏️: Archive one or more campaigns. Scheduled/recurring campaigns will be cancelled, running campaigns will be aborted.
- **cancel_campaign** ✏️: Cancel a scheduled or recurring campaign
- **create_and_schedule_campaign** ✏️✉️: Create a new blast campaign from an existing template and schedule it for delivery. The campaign is created in Scheduled state and will be sent to the specified lists at the given sendAt time.
- **create_blast_campaign** ✏️✉️: Create a new blast campaign from an existing template. By default, the campaign is created without being scheduled. Set scheduleSend to true to immediately schedule it for delivery at the given sendAt time.
- **create_triggered_campaign** ✏️: Create a new triggered campaign from an existing template. The campaign is created in Ready state and must be activated before it can send.
- **deactivate_triggered_campaign** ✏️: Deactivate a triggered campaign (requires API triggered campaign deactivation enabled)
- **get_campaign**: Get detailed information about a specific campaign
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
},
"dependencies": {
"@alcyone-labs/zod-to-json-schema": "4.0.10",
"@iterable/api": "0.8.0",
"@iterable/api": "0.8.1",
"@modelcontextprotocol/sdk": "1.18.1",
"@primno/dpapi": "2.0.1",
"@types/json-schema": "7.0.15",
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/tool-filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const NON_PII_TOOLS: Set<string> = new Set([
"archive_campaigns",
"bulk_delete_catalog_items",
"cancel_campaign",
"create_and_schedule_campaign",
"create_blast_campaign",
"create_triggered_campaign",
"create_catalog",
"create_list",
Expand Down Expand Up @@ -125,7 +125,7 @@ export const SEND_TOOLS: Set<string> = new Set([
"trigger_campaign",
"schedule_campaign",
// Creating a blast campaign schedules a send
"create_and_schedule_campaign",
"create_blast_campaign",
// Triggered campaigns can cause sends upon activation; block unless explicitly allowed
"activate_triggered_campaign",
// Journey triggers enqueue users which may send
Expand Down
10 changes: 5 additions & 5 deletions src/tools/campaigns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
ActivateTriggeredCampaignParamsSchema,
ArchiveCampaignsParamsSchema,
CancelCampaignParamsSchema,
CreateAndScheduleCampaignParamsSchema,
CreateBlastCampaignParamsSchema,
CreateTriggeredCampaignParamsSchema,
DeactivateTriggeredCampaignParamsSchema,
GetCampaignMetricsParamsSchema,
Expand Down Expand Up @@ -46,11 +46,11 @@ export function createCampaignTools(client: IterableClient): Tool[] {
execute: (params) => client.getCampaignMetrics(params),
}),
createTool({
name: "create_and_schedule_campaign",
name: "create_blast_campaign",
description:
"Create a new blast campaign from an existing template and schedule it for delivery. The campaign is created in Scheduled state and will be sent to the specified lists at the given sendAt time.",
schema: CreateAndScheduleCampaignParamsSchema,
execute: (params) => client.createAndScheduleCampaign(params),
"Create a new blast campaign from an existing template. By default, the campaign is created without being scheduled. Set scheduleSend to true to immediately schedule it for delivery at the given sendAt time.",
schema: CreateBlastCampaignParamsSchema,
execute: (params) => client.createBlastCampaign(params),
}),
createTool({
name: "create_triggered_campaign",
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/prompts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ describe("MCP Prompts", () => {
expect(promptNames).toContain("get-user-by-user-id");
expect(promptNames).toContain("get-campaigns");
expect(promptNames).toContain("get-experiment-metrics");
expect(promptNames).toContain("create-and-schedule-campaign");
expect(promptNames).toContain("create-blast-campaign");
expect(promptNames).toContain("create-triggered-campaign");
expect(promptNames).toContain("get-child-campaigns");
});
Expand Down Expand Up @@ -132,7 +132,7 @@ describe("MCP Prompts", () => {
expect(promptNames).toContain("get-campaigns");

// Should NOT include write or send tools
expect(promptNames).not.toContain("create-and-schedule-campaign");
expect(promptNames).not.toContain("create-blast-campaign");
expect(promptNames).not.toContain("update-user");
expect(promptNames).not.toContain("send-email");
expect(promptNames).not.toContain("send-email-template-proof");
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/send-tools-registry.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe("SEND_TOOLS registry", () => {
"send_campaign",
"trigger_campaign",
"schedule_campaign",
"create_and_schedule_campaign",
"create_blast_campaign",
"activate_triggered_campaign",
"trigger_journey",
"track_event",
Expand Down
8 changes: 3 additions & 5 deletions tests/unit/tool-filter-defaults.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe("filterTools defaults", () => {
} as any;

const writeTool: any = {
name: "create_and_schedule_campaign", // NOT in READ_ONLY_TOOLS
name: "create_blast_campaign", // NOT in READ_ONLY_TOOLS
description: "",
inputSchema: { type: "object", properties: {} },
handler: async () => ({}),
Expand All @@ -26,9 +26,7 @@ describe("filterTools defaults", () => {
})
);
expect(out.map((t) => t.name)).toContain("get_campaigns");
expect(out.map((t) => t.name)).not.toContain(
"create_and_schedule_campaign"
);
expect(out.map((t) => t.name)).not.toContain("create_blast_campaign");
});

it("includes write tools when allowWrites=true", () => {
Expand All @@ -40,6 +38,6 @@ describe("filterTools defaults", () => {
allowSends: true,
})
);
expect(out.map((t) => t.name)).toContain("create_and_schedule_campaign");
expect(out.map((t) => t.name)).toContain("create_blast_campaign");
});
});
4 changes: 2 additions & 2 deletions tests/unit/tool-filter-sends.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe("filterTools with allowSends", () => {
mkTool("send_campaign"),
mkTool("trigger_campaign"),
mkTool("schedule_campaign"),
mkTool("create_and_schedule_campaign"),
mkTool("create_blast_campaign"),
mkTool("track_event"),
mkTool("track_bulk_events"),
mkTool("trigger_journey"),
Expand Down Expand Up @@ -47,7 +47,7 @@ describe("filterTools with allowSends", () => {
expect(names.has("send_campaign")).toBe(false);
expect(names.has("trigger_campaign")).toBe(false);
expect(names.has("schedule_campaign")).toBe(false);
expect(names.has("create_and_schedule_campaign")).toBe(false);
expect(names.has("create_blast_campaign")).toBe(false);
expect(names.has("track_event")).toBe(false);
expect(names.has("track_bulk_events")).toBe(false);
expect(names.has("trigger_journey")).toBe(false);
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/tool-filter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ describe("Tool Filter", () => {
const filteredNames = filteredTools.map((tool) => tool.name);

const writeTools = [
"create_and_schedule_campaign",
"create_blast_campaign",
"create_triggered_campaign",
"update_user",
"delete_user_by_email",
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/tools.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const EXPECTED_TOOLS = [
"cancel_sms",
"cancel_web_push",
"cancel_whatsapp",
"create_and_schedule_campaign",
"create_blast_campaign",
"create_triggered_campaign",
"create_catalog",
"create_list",
Expand Down
Loading