@agifyai/leadify-mcp 3.5.0 → 3.6.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/server.js +1 -1
- package/dist/tools/fine_tuning.js +51 -0
- package/package.json +1 -1
package/dist/server.js
CHANGED
|
@@ -16,7 +16,7 @@ import { registerPipelineTools } from "./tools/pipeline.js";
|
|
|
16
16
|
export function createServer() {
|
|
17
17
|
const server = new McpServer({
|
|
18
18
|
name: "leadify",
|
|
19
|
-
version: "3.
|
|
19
|
+
version: "3.6.0",
|
|
20
20
|
});
|
|
21
21
|
registerAuthTools(server);
|
|
22
22
|
registerOrganizationTools(server);
|
|
@@ -4,6 +4,17 @@ import { toolResult, handleToolError } from "../types.js";
|
|
|
4
4
|
// Dedicated tool for the Fine Tuning page (separate from OutreachSettings).
|
|
5
5
|
// Both concepts live in the DB (FineTuning + OutreachSettings) and the API
|
|
6
6
|
// keeps them strictly separated: this endpoint NEVER touches OutreachSettings.
|
|
7
|
+
//
|
|
8
|
+
// Two write tools coexist by design, with NON-OVERLAPPING contracts:
|
|
9
|
+
// - append_fine_tuning → ALWAYS appends, never replaces. Contractual guarantee
|
|
10
|
+
// for the iterative build-up pattern (skill operator
|
|
11
|
+
// accumulates rules and examples as the user iterates).
|
|
12
|
+
// - set_fine_tuning → WHOLESALE replace of ONE section. Use when you need
|
|
13
|
+
// to wipe + rewrite a section cleanly (e.g. after a big
|
|
14
|
+
// refactor, or to clear a section by passing empty
|
|
15
|
+
// content).
|
|
16
|
+
// The split exists so neither caller is ever confused about which behavior
|
|
17
|
+
// they triggered.
|
|
7
18
|
export function registerFineTuningTools(server) {
|
|
8
19
|
// ── get_fine_tuning ───────────────────────────────────────────────────
|
|
9
20
|
server.tool("get_fine_tuning", "Get the fine tuning configuration for a specific lead group. Returns exactly " +
|
|
@@ -30,4 +41,44 @@ export function registerFineTuningTools(server) {
|
|
|
30
41
|
return handleToolError(error);
|
|
31
42
|
}
|
|
32
43
|
});
|
|
44
|
+
// ── set_fine_tuning ───────────────────────────────────────────────────
|
|
45
|
+
// WHOLESALE replace of one Fine Tuning section. Distinct from
|
|
46
|
+
// append_fine_tuning (which is append-only, contractual). Both tools
|
|
47
|
+
// coexist intentionally — pick the right one for the intent.
|
|
48
|
+
server.tool("set_fine_tuning", "WHOLESALE replace ONE section of the fine tuning configuration for a lead group. " +
|
|
49
|
+
"The target section is fully overwritten with the new content. " +
|
|
50
|
+
"This is the destructive counterpart of append_fine_tuning: use it when you need " +
|
|
51
|
+
"to wipe and rewrite a section cleanly (big refactor, schema change, full clear). " +
|
|
52
|
+
"SIBLING SECTIONS ARE NOT TOUCHED. Only the named section is replaced; the other 3 " +
|
|
53
|
+
"Markdown sections, supportedLanguages, and fallbackLanguage stay intact. " +
|
|
54
|
+
"To clear a section, pass content=\"\". " +
|
|
55
|
+
"DO NOT use this for incremental edits — use append_fine_tuning instead so the " +
|
|
56
|
+
"iterative build-up pattern is preserved (no accidental wipe of accumulated rules " +
|
|
57
|
+
"or examples). " +
|
|
58
|
+
"The 4 replaceable sections are: nonNegotiableRules, pitfalls, structure, examples. " +
|
|
59
|
+
"Languages (supportedLanguages, fallbackLanguage) are managed separately via the " +
|
|
60
|
+
"Fine Tuning UI or by a dedicated languages tool — this endpoint does not touch them.", {
|
|
61
|
+
lead_group_id: z
|
|
62
|
+
.string()
|
|
63
|
+
.describe("ID of the lead group whose fine tuning section to overwrite."),
|
|
64
|
+
section: z
|
|
65
|
+
.enum(["nonNegotiableRules", "pitfalls", "structure", "examples"])
|
|
66
|
+
.describe("Which Fine Tuning section to replace. One of: " +
|
|
67
|
+
"nonNegotiableRules | pitfalls | structure | examples."),
|
|
68
|
+
content: z
|
|
69
|
+
.string()
|
|
70
|
+
.describe("New content for the section (Markdown). The section is replaced WHOLESALE — " +
|
|
71
|
+
"any previous content is lost. Pass an empty string to clear the section."),
|
|
72
|
+
}, async ({ lead_group_id, section, content }) => {
|
|
73
|
+
try {
|
|
74
|
+
const data = await getClient().put(`/api/lead-group/${encodeURIComponent(lead_group_id)}/fine-tuning`, { section, content });
|
|
75
|
+
return toolResult({
|
|
76
|
+
...(data && typeof data === "object" ? data : {}),
|
|
77
|
+
_note: `Wholesale replace of section '${section}' for lead group ${lead_group_id}.`,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
return handleToolError(error);
|
|
82
|
+
}
|
|
83
|
+
});
|
|
33
84
|
}
|