@jobtarget/profiles-api-mcp 1.0.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 +331 -0
- package/dist/client/ProfilesApiClient.d.ts +19 -0
- package/dist/client/ProfilesApiClient.js +73 -0
- package/dist/config.d.ts +12 -0
- package/dist/config.js +19 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +10 -0
- package/dist/tools/CreateProfileLink.d.ts +34 -0
- package/dist/tools/CreateProfileLink.js +82 -0
- package/dist/tools/GetInvite.d.ts +19 -0
- package/dist/tools/GetInvite.js +39 -0
- package/dist/tools/GetProfile.d.ts +19 -0
- package/dist/tools/GetProfile.js +37 -0
- package/dist/tools/GetProfileLinks.d.ts +40 -0
- package/dist/tools/GetProfileLinks.js +89 -0
- package/dist/tools/QueryProfiles.d.ts +297 -0
- package/dist/tools/QueryProfiles.js +82 -0
- package/dist/tools/SearchProfiles.d.ts +101 -0
- package/dist/tools/SearchProfiles.js +109 -0
- package/package.json +25 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { MCPTool } from "mcp-framework";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { apiClient, ProfilesApiError } from "../client/ProfilesApiClient.js";
|
|
4
|
+
const WeightsSchema = z
|
|
5
|
+
.object({
|
|
6
|
+
w_text: z.number().optional().describe("Text relevance weight (default 0.60)"),
|
|
7
|
+
w_recency: z.number().optional().describe("Recency weight (default 0.03)"),
|
|
8
|
+
w_signal_data: z.number().optional().describe("Signal data weight (default 0.08)"),
|
|
9
|
+
w_contact: z.number().optional().describe("Contact info weight (default 0.05)"),
|
|
10
|
+
w_job_title: z.number().optional().describe("Job title weight (default 0.16)"),
|
|
11
|
+
w_distance: z.number().optional().describe("Distance weight (default 0.03)"),
|
|
12
|
+
w_phone: z.number().optional().describe("Phone availability weight (default 0.05)"),
|
|
13
|
+
})
|
|
14
|
+
.optional()
|
|
15
|
+
.describe("Scoring weights for result ranking");
|
|
16
|
+
export class SearchProfiles extends MCPTool {
|
|
17
|
+
name = "search_profiles";
|
|
18
|
+
description = "Search for candidate profiles using keyword and location criteria. " +
|
|
19
|
+
"Supports full-text search, geographic radius filtering, company/title filters, " +
|
|
20
|
+
"and custom relevance weights. Returns a ranked list of SourcerProfile objects.";
|
|
21
|
+
schema = z.object({
|
|
22
|
+
source: z
|
|
23
|
+
.enum(["PeopleDataLabs", "JobTarget", "ResumeLibrary"])
|
|
24
|
+
.describe("Data source to search: PeopleDataLabs, JobTarget, or ResumeLibrary"),
|
|
25
|
+
what: z
|
|
26
|
+
.string()
|
|
27
|
+
.min(1)
|
|
28
|
+
.describe("Search keywords (e.g. 'software engineer react', 'nurse practitioner')"),
|
|
29
|
+
where: z
|
|
30
|
+
.string()
|
|
31
|
+
.optional()
|
|
32
|
+
.describe("Location string (e.g. 'New York, NY'). Required when radius is specified."),
|
|
33
|
+
latitude: z
|
|
34
|
+
.number()
|
|
35
|
+
.optional()
|
|
36
|
+
.describe("Latitude for geo search. Must be paired with longitude."),
|
|
37
|
+
longitude: z
|
|
38
|
+
.number()
|
|
39
|
+
.optional()
|
|
40
|
+
.describe("Longitude for geo search. Must be paired with latitude."),
|
|
41
|
+
radius: z
|
|
42
|
+
.number()
|
|
43
|
+
.int()
|
|
44
|
+
.min(10)
|
|
45
|
+
.max(200)
|
|
46
|
+
.optional()
|
|
47
|
+
.describe("Search radius in miles (10–200). Requires where + latitude + longitude."),
|
|
48
|
+
page: z
|
|
49
|
+
.number()
|
|
50
|
+
.int()
|
|
51
|
+
.min(1)
|
|
52
|
+
.default(1)
|
|
53
|
+
.describe("Page number (1-based, default 1)"),
|
|
54
|
+
count: z
|
|
55
|
+
.number()
|
|
56
|
+
.int()
|
|
57
|
+
.min(1)
|
|
58
|
+
.max(100)
|
|
59
|
+
.default(10)
|
|
60
|
+
.describe("Results per page (1–100, default 10)"),
|
|
61
|
+
companies: z
|
|
62
|
+
.array(z.string())
|
|
63
|
+
.optional()
|
|
64
|
+
.describe("Filter by company names (e.g. ['Google', 'Meta'])"),
|
|
65
|
+
jobTitles: z
|
|
66
|
+
.array(z.string())
|
|
67
|
+
.optional()
|
|
68
|
+
.describe("Filter by job titles (e.g. ['Software Engineer', 'SRE'])"),
|
|
69
|
+
recentlyActive: z
|
|
70
|
+
.boolean()
|
|
71
|
+
.optional()
|
|
72
|
+
.describe("When true, only return recently active profiles"),
|
|
73
|
+
companyId: z
|
|
74
|
+
.number()
|
|
75
|
+
.int()
|
|
76
|
+
.optional()
|
|
77
|
+
.describe("Required when source is ResumeLibrary. Your company ID for RLI access."),
|
|
78
|
+
fuzziness: z
|
|
79
|
+
.enum(["Auto", "0", "1", "2"])
|
|
80
|
+
.optional()
|
|
81
|
+
.describe("Typo tolerance: Auto (auto-detect), 0 (exact), 1 (one edit), 2 (two edits). " +
|
|
82
|
+
"Cannot be used with type=cross_fields."),
|
|
83
|
+
type: z
|
|
84
|
+
.enum(["best_fields", "most_fields", "cross_fields"])
|
|
85
|
+
.optional()
|
|
86
|
+
.describe("Multi-match query type. best_fields (default), most_fields, or cross_fields. " +
|
|
87
|
+
"cross_fields cannot be combined with fuzziness."),
|
|
88
|
+
weights: WeightsSchema,
|
|
89
|
+
});
|
|
90
|
+
async execute(input) {
|
|
91
|
+
try {
|
|
92
|
+
const results = await apiClient.post("/api/v1/profiles/search", input);
|
|
93
|
+
return {
|
|
94
|
+
content: [
|
|
95
|
+
{
|
|
96
|
+
type: "text",
|
|
97
|
+
text: JSON.stringify(results, null, 2),
|
|
98
|
+
},
|
|
99
|
+
],
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
catch (error) {
|
|
103
|
+
if (error instanceof ProfilesApiError) {
|
|
104
|
+
throw new Error(`Profiles API error (${error.status}): ${error.message}`);
|
|
105
|
+
}
|
|
106
|
+
throw error;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@jobtarget/profiles-api-mcp",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "MCP server for the Profiles API — exposes profile search, retrieval, profile links, and invite endpoints as MCP tools.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
9
|
+
"bin": {
|
|
10
|
+
"profiles-api-mcp": "./dist/index.js"
|
|
11
|
+
},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "tsc",
|
|
14
|
+
"start": "node dist/index.js",
|
|
15
|
+
"dev": "npx ts-node --esm src/index.ts"
|
|
16
|
+
},
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"mcp-framework": "latest",
|
|
19
|
+
"zod": "^3.25.0"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@types/node": "^20.0.0",
|
|
23
|
+
"typescript": "^5.0.0"
|
|
24
|
+
}
|
|
25
|
+
}
|