@agifyai/leadify-mcp 8.6.11 → 8.7.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/README.md +1 -0
- package/dist/server.js +2 -0
- package/dist/tools/person_employment.d.ts +2 -0
- package/dist/tools/person_employment.js +35 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -232,6 +232,7 @@ Leadify et ne doit jamais être envoyée par un agent MCP.
|
|
|
232
232
|
| `create_lead_group` | Créer un groupe et choisir son type canonique optionnel (`GENERIC`, `COMPANY` ou `PERSON`) via `entity_kind`. |
|
|
233
233
|
| `update_lead_group` | Modifier un groupe, y compris son `entity_kind`, avec réconciliation du schéma côté Leadify. |
|
|
234
234
|
| `add_leads` | Ajouter un ou plusieurs leads à un groupe. |
|
|
235
|
+
| `upsert_person_leads_with_employment` | Créer ou réconcilier atomiquement des Person Leads, PERSON, EMPLOYED_BY, projections et historique, sans effet commercial. |
|
|
235
236
|
| `get_leads` | Rechercher et lister des leads avec filtres, recherche et pagination, dont le critère composé `event_filter`. |
|
|
236
237
|
| `get_lead` | Récupérer les détails complets d'un lead par son ID. |
|
|
237
238
|
| `update_lead` | Mettre à jour un ou plusieurs champs d'un lead existant. |
|
package/dist/server.js
CHANGED
|
@@ -19,6 +19,7 @@ import { registerCanonicalBackfillTools } from "./tools/canonical_backfill.js";
|
|
|
19
19
|
import { registerCommercialTruthTools } from "./tools/commercial_truth.js";
|
|
20
20
|
import { registerEventTools } from "./tools/events.js";
|
|
21
21
|
import { registerContextEntityTools } from "./tools/context_entities.js";
|
|
22
|
+
import { registerPersonEmploymentTools } from "./tools/person_employment.js";
|
|
22
23
|
import { MCP_SERVER_NAME, MCP_VERSION } from "./version.js";
|
|
23
24
|
export function createServer() {
|
|
24
25
|
const server = new McpServer({
|
|
@@ -32,6 +33,7 @@ export function createServer() {
|
|
|
32
33
|
registerLeadTools(server);
|
|
33
34
|
registerRelationshipTools(server);
|
|
34
35
|
registerCanonicalBackfillTools(server);
|
|
36
|
+
registerPersonEmploymentTools(server);
|
|
35
37
|
registerEventTools(server);
|
|
36
38
|
registerCommercialTruthTools(server);
|
|
37
39
|
registerSchemaTools(server);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { getClient } from "../client.js";
|
|
3
|
+
import { handleToolError, toolResult } from "../types.js";
|
|
4
|
+
export function registerPersonEmploymentTools(server, client = getClient()) {
|
|
5
|
+
server.tool("upsert_person_leads_with_employment", "Atomically create or reconcile Person Leads with their canonical PERSON identity, EMPLOYED_BY relationship, parent_lead/child_leads projections, evidence and append-only card_history. company_lead_id must be exact and already project an Account plus Legal Entity or compatible Establishment. Each batch entry is independently transactional and idempotent. This is the only supported Person write path for sourcing; never fall back to add_leads, canonical backfill, or separate relationship writes. It never qualifies, enriches contact details, sends outreach, creates campaigns, or activates anything.", {
|
|
6
|
+
people: z.array(z.object({
|
|
7
|
+
organization_id: z.string().trim().min(1),
|
|
8
|
+
person_group_id: z.string().trim().min(1),
|
|
9
|
+
company_lead_id: z.string().trim().min(1),
|
|
10
|
+
person_lead_id: z.string().trim().min(1).optional(),
|
|
11
|
+
fields: z.record(z.unknown()),
|
|
12
|
+
card_history_append: z.string().trim().min(1).max(100_000),
|
|
13
|
+
evidence_ids: z.array(z.string().trim().min(1)).min(1).max(100),
|
|
14
|
+
idempotency_key: z.string().trim().min(1).max(220),
|
|
15
|
+
}).strict()).min(1).max(100),
|
|
16
|
+
}, async ({ people }) => {
|
|
17
|
+
try {
|
|
18
|
+
return toolResult(await client.post("/api/person-employment/upsert", {
|
|
19
|
+
people: people.map((person) => ({
|
|
20
|
+
organizationId: person.organization_id,
|
|
21
|
+
personGroupId: person.person_group_id,
|
|
22
|
+
companyLeadId: person.company_lead_id,
|
|
23
|
+
personLeadId: person.person_lead_id,
|
|
24
|
+
fields: person.fields,
|
|
25
|
+
cardHistoryAppend: person.card_history_append,
|
|
26
|
+
evidenceIds: person.evidence_ids,
|
|
27
|
+
idempotencyKey: person.idempotency_key,
|
|
28
|
+
})),
|
|
29
|
+
}));
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
return handleToolError(error);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|