@agifyai/leadify-mcp 8.5.0 → 8.5.2
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 +16 -1
- package/dist/server.js +2 -0
- package/dist/tools/campaigns.d.ts +2 -1
- package/dist/tools/campaigns.js +10 -6
- package/dist/tools/commercial_truth.d.ts +48 -0
- package/dist/tools/commercial_truth.js +1141 -0
- package/dist/tools/fine_tuning.d.ts +4 -1
- package/dist/tools/fine_tuning.js +38 -3
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -2
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
-
|
|
2
|
+
import { type LeadifyClient } from "../client.js";
|
|
3
|
+
type FineTuningClient = Pick<LeadifyClient, "get" | "patch">;
|
|
4
|
+
export declare function registerFineTuningTools(server: McpServer, client?: FineTuningClient): void;
|
|
5
|
+
export {};
|
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { getClient } from "../client.js";
|
|
3
3
|
import { toolResult, handleToolError } from "../types.js";
|
|
4
|
+
const outputSettingSchema = z.discriminatedUnion("enabled", [
|
|
5
|
+
z.object({ enabled: z.literal(true), count: z.number().int().min(1).max(5) }).strict(),
|
|
6
|
+
z.object({ enabled: z.literal(false) }).strict(),
|
|
7
|
+
]);
|
|
8
|
+
const outputConfigSchema = z.object({
|
|
9
|
+
mode: z.literal("selected"),
|
|
10
|
+
outputs: z.object({
|
|
11
|
+
linkedinConnection: z.discriminatedUnion("enabled", [
|
|
12
|
+
z.object({ enabled: z.literal(true), count: z.literal(1) }).strict(),
|
|
13
|
+
z.object({ enabled: z.literal(false) }).strict(),
|
|
14
|
+
]),
|
|
15
|
+
linkedinMessage: outputSettingSchema,
|
|
16
|
+
email: outputSettingSchema,
|
|
17
|
+
}).strict().refine((outputs) => Object.values(outputs).some((output) => output.enabled), "At least one output category must be enabled."),
|
|
18
|
+
}).strict();
|
|
4
19
|
// Dedicated tool for the Fine Tuning page (separate from OutreachSettings).
|
|
5
20
|
// Both concepts live in the DB (FineTuning + OutreachSettings) and the API
|
|
6
21
|
// keeps them strictly separated: this endpoint NEVER touches OutreachSettings.
|
|
@@ -15,7 +30,7 @@ import { toolResult, handleToolError } from "../types.js";
|
|
|
15
30
|
// content).
|
|
16
31
|
// The split exists so neither caller is ever confused about which behavior
|
|
17
32
|
// they triggered.
|
|
18
|
-
export function registerFineTuningTools(server) {
|
|
33
|
+
export function registerFineTuningTools(server, client) {
|
|
19
34
|
// ── get_fine_tuning ───────────────────────────────────────────────────
|
|
20
35
|
server.tool("get_fine_tuning", "Get the fine tuning configuration for a specific lead group. Returns exactly " +
|
|
21
36
|
"the 5 levers of the Fine Tuning page and nothing else: " +
|
|
@@ -34,7 +49,7 @@ export function registerFineTuningTools(server) {
|
|
|
34
49
|
"banned in the outreach pipeline)."),
|
|
35
50
|
}, async ({ lead_group_id }) => {
|
|
36
51
|
try {
|
|
37
|
-
const data = await getClient().get(`/api/lead-group/${encodeURIComponent(lead_group_id)}/fine-tuning`);
|
|
52
|
+
const data = await (client ?? getClient()).get(`/api/lead-group/${encodeURIComponent(lead_group_id)}/fine-tuning`);
|
|
38
53
|
return toolResult(data);
|
|
39
54
|
}
|
|
40
55
|
catch (error) {
|
|
@@ -76,7 +91,7 @@ export function registerFineTuningTools(server) {
|
|
|
76
91
|
"any previous content is lost. Pass an empty string to clear the section."),
|
|
77
92
|
}, async ({ lead_group_id, section, content }) => {
|
|
78
93
|
try {
|
|
79
|
-
const data = await getClient().patch(`/api/lead-group/${encodeURIComponent(lead_group_id)}/fine-tuning/section/${encodeURIComponent(section)}`, { content });
|
|
94
|
+
const data = await (client ?? getClient()).patch(`/api/lead-group/${encodeURIComponent(lead_group_id)}/fine-tuning/section/${encodeURIComponent(section)}`, { content });
|
|
80
95
|
return toolResult({
|
|
81
96
|
...(data && typeof data === "object" ? data : {}),
|
|
82
97
|
_note: `Wholesale replace of section '${section}' for lead group ${lead_group_id}.`,
|
|
@@ -86,4 +101,24 @@ export function registerFineTuningTools(server) {
|
|
|
86
101
|
return handleToolError(error);
|
|
87
102
|
}
|
|
88
103
|
});
|
|
104
|
+
// ── set_fine_tuning_output_config ─────────────────────────────────────
|
|
105
|
+
server.tool("set_fine_tuning_output_config", "Replace ONLY the business output configuration of a lead group's Fine Tuning. " +
|
|
106
|
+
"Use this when its enabled output categories or quantities must change. " +
|
|
107
|
+
"Accepts only the business categories linkedinConnection, linkedinMessage, and email; " +
|
|
108
|
+
"it never accepts technical card or field names. A selected configuration must enable at " +
|
|
109
|
+
"least one category; enabled linkedinConnection is exactly 1, while LinkedIn messages and " +
|
|
110
|
+
"emails are 1–5. Markdown sections, supportedLanguages, and fallbackLanguage are preserved. " +
|
|
111
|
+
"This only persists Fine Tuning configuration: it never generates outreach, schedules work, " +
|
|
112
|
+
"activates campaigns, or sends messages. Returns the exact persisted Fine Tuning configuration.", {
|
|
113
|
+
lead_group_id: z.string().describe("ID of the accessible lead group whose output configuration to update."),
|
|
114
|
+
output_config: outputConfigSchema.describe("Selected business output configuration. Provide all three category keys and no technical card/field names."),
|
|
115
|
+
}, async ({ lead_group_id, output_config }) => {
|
|
116
|
+
try {
|
|
117
|
+
const data = await (client ?? getClient()).patch(`/api/lead-group/${encodeURIComponent(lead_group_id)}/fine-tuning/output-config`, { outputConfig: output_config });
|
|
118
|
+
return toolResult(data);
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
return handleToolError(error);
|
|
122
|
+
}
|
|
123
|
+
});
|
|
89
124
|
}
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agifyai/leadify-mcp",
|
|
3
|
-
"version": "8.5.
|
|
3
|
+
"version": "8.5.2",
|
|
4
4
|
"description": "MCP server for Leadify lead management API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -15,8 +15,9 @@
|
|
|
15
15
|
"build": "rm -rf dist && tsc && chmod +x dist/index.js",
|
|
16
16
|
"start": "node dist/index.js",
|
|
17
17
|
"dev": "tsc --watch",
|
|
18
|
+
"canary:commercial": "npm run build && zsh scripts/run-commercial-truth-read-canary.sh",
|
|
18
19
|
"prepublishOnly": "npm run build",
|
|
19
|
-
"test": "npm run build && node --test test
|
|
20
|
+
"test": "npm run build && node --test test/*.test.mjs"
|
|
20
21
|
},
|
|
21
22
|
"repository": {
|
|
22
23
|
"type": "git",
|