@agifyai/leadify-mcp 8.7.1 → 8.7.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 CHANGED
@@ -233,6 +233,7 @@ Leadify et ne doit jamais être envoyée par un agent MCP.
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
235
  | `upsert_person_leads_with_employment` | Créer ou réconcilier atomiquement des Person Leads, PERSON, EMPLOYED_BY, projections et historique, sans effet commercial. |
236
+ | `create_person_employment_evidence` / `get_person_employment_evidence` | Créer puis relire une preuve d’emploi individuelle tenant-scopée ; transmettre l’`evidence.id` retourné tel quel à l’upsert Person. |
236
237
  | `get_leads` | Rechercher et lister des leads avec filtres, recherche et pagination, dont le critère composé `event_filter`. |
237
238
  | `get_lead` | Récupérer les détails complets d'un lead par son ID. |
238
239
  | `update_lead` | Mettre à jour un ou plusieurs champs d'un lead existant. |
@@ -320,3 +321,7 @@ Leadify et ne doit jamais être envoyée par un agent MCP.
320
321
  | `append_fine_tuning` | Appendre du contenu à une section du Fine Tuning (nonNegotiableRules, pitfalls, structure, examples). Toujours en mode append — garantie contractuelle. |
321
322
  | `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. |
322
323
  | `pipeline_next_lead` | Sélectionner le prochain lead à traiter (score descendant, sans message). Exclusion des IDs déjà vus, limit 1-5. |
324
+
325
+ ### `source-icp-prospects` : preuve d’emploi
326
+
327
+ Pour chaque candidat accepté, créer `create_person_employment_evidence` avec le tenant, la Company Lead, l’identité Person, la provenance et une clé idempotente. Relire si nécessaire avec `get_person_employment_evidence`, puis transmettre exclusivement l’`evidence.id` retourné dans `evidence_ids` de `upsert_person_leads_with_employment`.
@@ -1,7 +1,49 @@
1
1
  import { z } from "zod";
2
2
  import { getClient } from "../client.js";
3
3
  import { handleToolError, toolResult } from "../types.js";
4
+ const evidenceDate = z.string().datetime();
5
+ const evidenceId = z.string().trim().min(1);
4
6
  export function registerPersonEmploymentTools(server, client = getClient()) {
7
+ server.tool("create_person_employment_evidence", "Create one tenant-scoped, idempotent employment proof for an exact Person and Company Lead. Use the returned evidence.id unchanged in upsert_person_leads_with_employment; do not invent or reuse Company or event evidence IDs.", {
8
+ organization_id: z.string().trim().min(1),
9
+ company_lead_id: z.string().trim().min(1),
10
+ person: z.object({
11
+ full_name: z.string().trim().min(1).max(500),
12
+ email: z.string().trim().email().max(320).optional(),
13
+ linkedin_url: z.string().trim().url().max(2_000).optional(),
14
+ }).strict(),
15
+ provider: z.string().trim().min(1).max(120),
16
+ source_url: z.string().trim().url().max(2_000),
17
+ excerpt: z.string().trim().min(1).max(20_000),
18
+ observed_at: evidenceDate,
19
+ verified_at: evidenceDate,
20
+ idempotency_key: z.string().trim().min(1).max(220),
21
+ }, async ({ organization_id, company_lead_id, person, provider, source_url, excerpt, observed_at, verified_at, idempotency_key }) => {
22
+ try {
23
+ return toolResult(await client.post("/api/person-employment/evidence", {
24
+ organizationId: organization_id,
25
+ companyLeadId: company_lead_id,
26
+ person: { fullName: person.full_name, email: person.email, linkedinUrl: person.linkedin_url },
27
+ provider,
28
+ sourceUrl: source_url,
29
+ excerpt,
30
+ observedAt: observed_at,
31
+ verifiedAt: verified_at,
32
+ idempotencyKey: idempotency_key,
33
+ }));
34
+ }
35
+ catch (error) {
36
+ return handleToolError(error);
37
+ }
38
+ });
39
+ server.tool("get_person_employment_evidence", "Read back one employment proof only within the explicitly selected tenant. Use this to obtain or verify the evidence.id before the atomic Person employment upsert.", { organization_id: z.string().trim().min(1), evidence_id: evidenceId }, async ({ organization_id, evidence_id }) => {
40
+ try {
41
+ return toolResult(await client.get(`/api/person-employment/evidence/${encodeURIComponent(evidence_id)}`, new URLSearchParams({ organizationId: organization_id })));
42
+ }
43
+ catch (error) {
44
+ return handleToolError(error);
45
+ }
46
+ });
5
47
  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
48
  people: z.array(z.object({
7
49
  organization_id: z.string().trim().min(1),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agifyai/leadify-mcp",
3
- "version": "8.7.1",
3
+ "version": "8.7.2",
4
4
  "description": "MCP server for Leadify lead management API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",