@agifyai/leadify-mcp 7.0.0 → 7.1.0
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/dist/tools/pipeline.js +34 -3
- package/package.json +1 -1
package/dist/tools/pipeline.js
CHANGED
|
@@ -4,7 +4,7 @@ import { toolResult, toolError, handleToolError } from "../types.js";
|
|
|
4
4
|
export function registerPipelineTools(server) {
|
|
5
5
|
// ── trigger_outreach ─────────────────────────────────────────────────────
|
|
6
6
|
server.tool("trigger_outreach", "Generate the outreach message SEQUENCE for a lead via the Trigger.dev agent " +
|
|
7
|
-
"(Leadify
|
|
7
|
+
"(Leadify v3 writer). The agent is a PURE MESSAGE WRITER: it produces a multi-touch " +
|
|
8
8
|
"sequence (card_connexion, card_linkedin_one/two/three, card_email_one/two/three plus " +
|
|
9
9
|
"their subjects), filtered to the channels the lead can actually receive. It does NOT " +
|
|
10
10
|
"score, tier, analyse or research — there is no card_analysis/card_research/score/tier " +
|
|
@@ -27,7 +27,14 @@ export function registerPipelineTools(server) {
|
|
|
27
27
|
"this is NOT a failure — the run keeps going server-side, follow it via the " +
|
|
28
28
|
"traceUrl. In dry-run (dryrun=true) the call is safe to retry, since nothing is " +
|
|
29
29
|
"persisted; for production writes (dryrun=false) prefer following the trace over " +
|
|
30
|
-
"blindly retrying to avoid duplicate generation."
|
|
30
|
+
"blindly retrying to avoid duplicate generation. " +
|
|
31
|
+
"CARDS SUBSET (cards_to_generate): pass an explicit list of card names to restrict " +
|
|
32
|
+
"the generation to a specific subset. Use this for single-touch campaigns or " +
|
|
33
|
+
"when the full 10-card cycle is not needed. Omit to generate the full sequence " +
|
|
34
|
+
"(default). Subject fields (card_email_one_subject, etc.) should always accompany " +
|
|
35
|
+
"their body card. Valid card names: card_connexion, card_linkedin_one, " +
|
|
36
|
+
"card_linkedin_two, card_linkedin_three, card_email_one, card_email_one_subject, " +
|
|
37
|
+
"card_email_two, card_email_two_subject, card_email_three, card_email_three_subject.", {
|
|
31
38
|
lead_id: z.string().describe("ID of the lead to generate a message for."),
|
|
32
39
|
dryrun: z
|
|
33
40
|
.boolean()
|
|
@@ -42,7 +49,28 @@ export function registerPipelineTools(server) {
|
|
|
42
49
|
.default(false)
|
|
43
50
|
.describe("true = bypass the 'already has a message?' check so you can re-generate. " +
|
|
44
51
|
"false (default) = normal behaviour: skip leads that already have card_message."),
|
|
45
|
-
|
|
52
|
+
cards_to_generate: z
|
|
53
|
+
.array(z.enum([
|
|
54
|
+
"card_connexion",
|
|
55
|
+
"card_linkedin_one",
|
|
56
|
+
"card_linkedin_two",
|
|
57
|
+
"card_linkedin_three",
|
|
58
|
+
"card_email_one",
|
|
59
|
+
"card_email_one_subject",
|
|
60
|
+
"card_email_two",
|
|
61
|
+
"card_email_two_subject",
|
|
62
|
+
"card_email_three",
|
|
63
|
+
"card_email_three_subject",
|
|
64
|
+
]))
|
|
65
|
+
.min(1)
|
|
66
|
+
.optional()
|
|
67
|
+
.describe("Optional subset of outreach cards to generate. When omitted, all cards are " +
|
|
68
|
+
"generated (default behaviour — full 10-card sequence). When provided, ONLY " +
|
|
69
|
+
"these cards are generated. Example for single-touch: " +
|
|
70
|
+
"['card_connexion', 'card_linkedin_one', 'card_email_one', 'card_email_one_subject']. " +
|
|
71
|
+
"Subject fields must always accompany their body card. Cards for channels the " +
|
|
72
|
+
"lead doesn't have (e.g. email when no email address) are silently dropped."),
|
|
73
|
+
}, async ({ lead_id, dryrun, force, cards_to_generate }) => {
|
|
46
74
|
try {
|
|
47
75
|
// Resolve leadGroupId server-side. The Trigger.dev task payload requires
|
|
48
76
|
// `leadGroupId`, but the lead_id alone is enough on the MCP side — we
|
|
@@ -68,6 +96,9 @@ export function registerPipelineTools(server) {
|
|
|
68
96
|
dryrun,
|
|
69
97
|
force,
|
|
70
98
|
};
|
|
99
|
+
if (cards_to_generate && cards_to_generate.length > 0) {
|
|
100
|
+
body.cardsToGenerate = cards_to_generate;
|
|
101
|
+
}
|
|
71
102
|
const data = (await getClient().post("/api/trigger-outreach", body));
|
|
72
103
|
// Decorate the response with a Trigger.dev run deep-link when the
|
|
73
104
|
// backend didn't ship one. Applies to BOTH success and failure paths
|