@agifyai/leadify-mcp 8.5.2 → 8.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/tools/campaigns.d.ts +2 -1
- package/dist/tools/campaigns.js +37 -7
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -219,7 +219,8 @@ Leadify et ne doit jamais être envoyée par un agent MCP.
|
|
|
219
219
|
| `get_campaign_logs` | Récupérer les logs de campagne avec filtres et pagination. |
|
|
220
220
|
| `delete_campaign_log` | Supprimer une entrée de log de campagne. |
|
|
221
221
|
| `update_campaign_stats` | Mettre à jour les statistiques d'email d'une campagne pour un groupe de leads. |
|
|
222
|
-
| `create_campaign` | Créer une campagne DRAFT mono-canal rattachée à un groupe de leads. `channel` (`LINKEDIN` ou `EMAIL`) est obligatoire
|
|
222
|
+
| `create_campaign` | Créer une campagne DRAFT mono-canal rattachée à un groupe de leads. `channel` (`LINKEDIN` ou `EMAIL`) est obligatoire ; `start_at`, `end_at` et `timezone` configurent la fenêtre métier. À `end_at`, Leadify ferme la campagne idempotemment, annule uniquement les jobs prouvablement pré-fournisseur et préserve les autres pour réconciliation. |
|
|
223
|
+
| `update_campaign_configuration` | Corriger le canal ou la fenêtre d'une campagne DRAFT encore ouverte, sans activation ni enrôlement. |
|
|
223
224
|
| `list_campaigns` | Lister compactement les campagnes d'une organisation explicitement sélectionnée et leur statut courant. |
|
|
224
225
|
| `get_campaign` | Récupérer les détails d'une campagne et ses KPIs temps réel. |
|
|
225
226
|
| `update_campaign_status` | Changer le statut d'une campagne (DRAFT, ACTIVE, PAUSED, COMPLETED). |
|
|
@@ -2,5 +2,6 @@ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
|
2
2
|
import { type LeadifyClient } from "../client.js";
|
|
3
3
|
type CampaignReadClient = Pick<LeadifyClient, "get">;
|
|
4
4
|
type CampaignWriteClient = Pick<LeadifyClient, "post">;
|
|
5
|
-
|
|
5
|
+
type CampaignMutationClient = Pick<LeadifyClient, "put">;
|
|
6
|
+
export declare function registerCampaignTools(server: McpServer, readClient?: CampaignReadClient, writeClient?: CampaignWriteClient, mutationClient?: CampaignMutationClient): void;
|
|
6
7
|
export {};
|
package/dist/tools/campaigns.js
CHANGED
|
@@ -19,7 +19,7 @@ function assertCampaignBelongsToOrganization(data, organizationId) {
|
|
|
19
19
|
}
|
|
20
20
|
return campaign;
|
|
21
21
|
}
|
|
22
|
-
export function registerCampaignTools(server, readClient, writeClient) {
|
|
22
|
+
export function registerCampaignTools(server, readClient, writeClient, mutationClient) {
|
|
23
23
|
// ── update_campaign_stats ──────────────────────────────────────────────
|
|
24
24
|
server.tool("update_campaign_stats", "Update email campaign statistics for a lead group. If the given campaignSlug " +
|
|
25
25
|
"doesn't exist in the group's stats yet, it is created; otherwise provided fields " +
|
|
@@ -88,26 +88,33 @@ export function registerCampaignTools(server, readClient, writeClient) {
|
|
|
88
88
|
}
|
|
89
89
|
});
|
|
90
90
|
// ── create_campaign ────────────────────────────────────────────────────
|
|
91
|
-
server.tool("create_campaign", "Create a mono-channel DRAFT campaign
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"campaign until that API support is released. Returns the new campaign ID; use " +
|
|
95
|
-
"update_campaign_status only after the campaign is fully configured and explicitly approved.", {
|
|
91
|
+
server.tool("create_campaign", "Create a mono-channel DRAFT campaign with an explicit channel, optional ISO-8601 start/end " +
|
|
92
|
+
"window, and IANA timezone. At endAt Leadify closes the campaign idempotently, cancels only " +
|
|
93
|
+
"pre-provider jobs, and preserves any provider-barrier job for reconciliation.", {
|
|
96
94
|
name: z.string().describe("Campaign name."),
|
|
97
95
|
lead_group_id: z.string().describe("ID of the lead group to associate."),
|
|
98
96
|
channel: z.enum(["LINKEDIN", "EMAIL"]).describe("Required effective delivery channel. Create separate campaigns for LinkedIn and email."),
|
|
97
|
+
start_at: z.string().datetime().optional().describe("Optional inclusive campaign start timestamp in ISO-8601 UTC."),
|
|
98
|
+
end_at: z.string().datetime().optional().describe("Optional exclusive campaign end timestamp in ISO-8601 UTC; must be after start_at."),
|
|
99
|
+
timezone: z.string().min(1).optional().describe("IANA timezone used for the campaign business window, for example Europe/Paris."),
|
|
99
100
|
description: z.string().optional().describe("Optional description."),
|
|
100
101
|
persona_id: z
|
|
101
102
|
.string()
|
|
102
103
|
.optional()
|
|
103
104
|
.describe("ID of the persona to assign (optional)."),
|
|
104
|
-
}, async ({ name, lead_group_id, channel, description, persona_id }) => {
|
|
105
|
+
}, async ({ name, lead_group_id, channel, start_at, end_at, timezone, description, persona_id }) => {
|
|
105
106
|
try {
|
|
106
107
|
const body = {
|
|
107
108
|
name,
|
|
108
109
|
leadGroupId: lead_group_id,
|
|
109
110
|
channel,
|
|
110
111
|
};
|
|
112
|
+
if (start_at !== undefined)
|
|
113
|
+
body.startAt = start_at;
|
|
114
|
+
if (end_at !== undefined)
|
|
115
|
+
body.endAt = end_at;
|
|
116
|
+
if (timezone !== undefined)
|
|
117
|
+
body.timezone = timezone;
|
|
111
118
|
if (description !== undefined)
|
|
112
119
|
body.description = description;
|
|
113
120
|
if (persona_id !== undefined)
|
|
@@ -119,6 +126,29 @@ export function registerCampaignTools(server, readClient, writeClient) {
|
|
|
119
126
|
return handleToolError(error);
|
|
120
127
|
}
|
|
121
128
|
});
|
|
129
|
+
server.tool("update_campaign_configuration", "Correct an open DRAFT campaign's channel or lifecycle window before activation. This tool refuses ACTIVE, PAUSED, COMPLETED, or closed campaigns and never activates or enrolls prospects.", {
|
|
130
|
+
id: z.string().describe("Campaign ID."),
|
|
131
|
+
channel: z.enum(["LINKEDIN", "EMAIL"]).optional(),
|
|
132
|
+
start_at: z.string().datetime().nullable().optional(),
|
|
133
|
+
end_at: z.string().datetime().nullable().optional(),
|
|
134
|
+
timezone: z.string().min(1).optional(),
|
|
135
|
+
}, async ({ id, channel, start_at, end_at, timezone }) => {
|
|
136
|
+
try {
|
|
137
|
+
const body = {};
|
|
138
|
+
if (channel !== undefined)
|
|
139
|
+
body.channel = channel;
|
|
140
|
+
if (start_at !== undefined)
|
|
141
|
+
body.startAt = start_at;
|
|
142
|
+
if (end_at !== undefined)
|
|
143
|
+
body.endAt = end_at;
|
|
144
|
+
if (timezone !== undefined)
|
|
145
|
+
body.timezone = timezone;
|
|
146
|
+
return toolResult(await (mutationClient ?? getClient()).put(`/api/campaign/${encodeURIComponent(id)}/configuration`, body));
|
|
147
|
+
}
|
|
148
|
+
catch (error) {
|
|
149
|
+
return handleToolError(error);
|
|
150
|
+
}
|
|
151
|
+
});
|
|
122
152
|
// ── get_campaign ───────────────────────────────────────────────────────
|
|
123
153
|
server.tool("get_campaign", "Retrieve a campaign chosen from list_campaigns, scoped to the explicitly selected " +
|
|
124
154
|
"organization. Includes its normalized current status (DRAFT, ACTIVE, PAUSED, or COMPLETED) " +
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED