@agifyai/leadify-mcp 8.5.0 → 8.5.1

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 CHANGED
@@ -259,4 +259,5 @@ Leadify et ne doit jamais être envoyée par un agent MCP.
259
259
  | `set_outreach_connection_request` | Toggle du flag connectionRequestEnabled (LinkedIn invite vs cold DM). |
260
260
  | `trigger_outreach` | Générer un message d'outreach via l'agent Trigger.dev (dry-run par défaut). `force=true` pour re-générer sur un lead déjà traité. |
261
261
  | `append_fine_tuning` | Appendre du contenu à une section du Fine Tuning (nonNegotiableRules, pitfalls, structure, examples). Toujours en mode append — garantie contractuelle. |
262
+ | `set_fine_tuning_output_config` | Remplacer uniquement la configuration métier de sorties d’un Fine Tuning (`linkedinConnection`, `linkedinMessage`, `email`, activations et quantités). Préserve Markdown, langues et fallback ; ne génère, ne planifie, n’active ni n’envoie aucun outreach. |
262
263
  | `pipeline_next_lead` | Sélectionner le prochain lead à traiter (score descendant, sans message). Exclusion des IDs déjà vus, limit 1-5. |
@@ -1,2 +1,5 @@
1
1
  import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
- export declare function registerFineTuningTools(server: McpServer): void;
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
@@ -1,3 +1,3 @@
1
1
  export declare const MCP_PACKAGE_NAME = "@agifyai/leadify-mcp";
2
2
  export declare const MCP_SERVER_NAME = "leadify";
3
- export declare const MCP_VERSION = "8.5.0";
3
+ export declare const MCP_VERSION = "8.5.1";
package/dist/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  export const MCP_PACKAGE_NAME = "@agifyai/leadify-mcp";
2
2
  export const MCP_SERVER_NAME = "leadify";
3
- export const MCP_VERSION = "8.5.0";
3
+ export const MCP_VERSION = "8.5.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agifyai/leadify-mcp",
3
- "version": "8.5.0",
3
+ "version": "8.5.1",
4
4
  "description": "MCP server for Leadify lead management API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",