@sellable/mcp 0.1.860 → 0.1.861
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/tools/enrichment.d.ts +14 -0
- package/dist/tools/enrichment.js +60 -12
- package/dist/tools/registry.d.ts +4 -0
- package/package.json +1 -1
|
@@ -14,6 +14,7 @@ export type BulkEnrichWithProspeoInput = {
|
|
|
14
14
|
first_name?: string;
|
|
15
15
|
last_name?: string;
|
|
16
16
|
company_name?: string;
|
|
17
|
+
company_website?: string;
|
|
17
18
|
}>;
|
|
18
19
|
onlyVerifiedEmail?: boolean;
|
|
19
20
|
};
|
|
@@ -84,6 +85,10 @@ export declare const enrichmentToolDefinitions: ({
|
|
|
84
85
|
company_name: {
|
|
85
86
|
type: string;
|
|
86
87
|
};
|
|
88
|
+
company_website: {
|
|
89
|
+
type: string;
|
|
90
|
+
description: string;
|
|
91
|
+
};
|
|
87
92
|
};
|
|
88
93
|
required: string[];
|
|
89
94
|
};
|
|
@@ -121,6 +126,14 @@ export declare const enrichmentToolDefinitions: ({
|
|
|
121
126
|
})[];
|
|
122
127
|
export declare function enrichWithProspeo(input: EnrichWithProspeoInput): Promise<{
|
|
123
128
|
success: boolean;
|
|
129
|
+
matched: boolean;
|
|
130
|
+
creditsUsed: number;
|
|
131
|
+
reason: string;
|
|
132
|
+
person: null;
|
|
133
|
+
company: null;
|
|
134
|
+
} | {
|
|
135
|
+
success: boolean;
|
|
136
|
+
matched: boolean;
|
|
124
137
|
creditsUsed: number;
|
|
125
138
|
person: {
|
|
126
139
|
name: string | undefined;
|
|
@@ -139,6 +152,7 @@ export declare function enrichWithProspeo(input: EnrichWithProspeoInput): Promis
|
|
|
139
152
|
industry: string | undefined;
|
|
140
153
|
employeeRange: string | undefined;
|
|
141
154
|
} | null;
|
|
155
|
+
reason?: undefined;
|
|
142
156
|
}>;
|
|
143
157
|
export declare function bulkEnrichWithProspeo(input: BulkEnrichWithProspeoInput): Promise<{
|
|
144
158
|
success: boolean;
|
package/dist/tools/enrichment.js
CHANGED
|
@@ -67,6 +67,10 @@ export const enrichmentToolDefinitions = [
|
|
|
67
67
|
company_name: {
|
|
68
68
|
type: "string",
|
|
69
69
|
},
|
|
70
|
+
company_website: {
|
|
71
|
+
type: "string",
|
|
72
|
+
description: "Company website or domain",
|
|
73
|
+
},
|
|
70
74
|
},
|
|
71
75
|
required: ["identifier"],
|
|
72
76
|
},
|
|
@@ -98,21 +102,65 @@ export async function enrichWithProspeo(input) {
|
|
|
98
102
|
if (!hasLinkedIn && !(hasName && hasCompany)) {
|
|
99
103
|
throw new Error("Must provide linkedinUrl OR (firstName + lastName + company info)");
|
|
100
104
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
105
|
+
let normalized;
|
|
106
|
+
let creditsUsed;
|
|
107
|
+
if (input.enrichMobile) {
|
|
108
|
+
const response = await api.post("/api/v3/prospeo/enrich", {
|
|
109
|
+
linkedinUrl: input.linkedinUrl,
|
|
110
|
+
firstName: input.firstName,
|
|
111
|
+
lastName: input.lastName,
|
|
112
|
+
companyName: input.companyName,
|
|
113
|
+
companyWebsite: input.companyWebsite,
|
|
114
|
+
onlyVerifiedEmail: input.onlyVerifiedEmail ?? true,
|
|
115
|
+
enrichMobile: true,
|
|
116
|
+
normalize: true,
|
|
117
|
+
});
|
|
118
|
+
normalized = response.normalized;
|
|
119
|
+
creditsUsed = response.creditsUsed;
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
// Prospeo's legacy single-person wrapper currently rejects otherwise-valid
|
|
123
|
+
// email lookups that the bulk endpoint accepts. Adapt one record through
|
|
124
|
+
// the working transport while preserving this tool's public response.
|
|
125
|
+
const identifier = "single-enrichment";
|
|
126
|
+
const response = await api.post("/api/v3/prospeo/bulk-enrich", {
|
|
127
|
+
inputs: [
|
|
128
|
+
{
|
|
129
|
+
identifier,
|
|
130
|
+
...(input.linkedinUrl ? { linkedin_url: input.linkedinUrl } : {}),
|
|
131
|
+
...(input.firstName ? { first_name: input.firstName } : {}),
|
|
132
|
+
...(input.lastName ? { last_name: input.lastName } : {}),
|
|
133
|
+
...(input.companyName ? { company_name: input.companyName } : {}),
|
|
134
|
+
...(input.companyWebsite
|
|
135
|
+
? { company_website: input.companyWebsite }
|
|
136
|
+
: {}),
|
|
137
|
+
},
|
|
138
|
+
],
|
|
139
|
+
onlyVerifiedEmail: input.onlyVerifiedEmail ?? true,
|
|
140
|
+
normalize: true,
|
|
141
|
+
});
|
|
142
|
+
const match = response.matched.find((candidate) => candidate.identifier === identifier);
|
|
143
|
+
if (!match) {
|
|
144
|
+
return {
|
|
145
|
+
success: false,
|
|
146
|
+
matched: false,
|
|
147
|
+
creditsUsed: response.totalCost,
|
|
148
|
+
reason: response.invalidDatapoints.includes(identifier)
|
|
149
|
+
? "invalid_datapoint"
|
|
150
|
+
: "not_matched",
|
|
151
|
+
person: null,
|
|
152
|
+
company: null,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
normalized = match.normalized;
|
|
156
|
+
creditsUsed = response.totalCost;
|
|
157
|
+
}
|
|
111
158
|
// Return compact summary for LLM
|
|
112
|
-
const n =
|
|
159
|
+
const n = normalized;
|
|
113
160
|
return {
|
|
114
161
|
success: true,
|
|
115
|
-
|
|
162
|
+
matched: true,
|
|
163
|
+
creditsUsed,
|
|
116
164
|
person: {
|
|
117
165
|
name: n?.name,
|
|
118
166
|
title: n?.title,
|
package/dist/tools/registry.d.ts
CHANGED