diff --git a/package-lock.json b/package-lock.json index aab4301..2d76a6c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@linkedapi/mcp", - "version": "2.3.22", + "version": "2.3.23", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@linkedapi/mcp", - "version": "2.3.22", + "version": "2.3.23", "license": "MIT", "dependencies": { "@linkedapi/node": "^2.3.21", diff --git a/package.json b/package.json index cb98ef3..fed12a2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@linkedapi/mcp", - "version": "2.3.22", + "version": "2.3.23", "description": "MCP server that lets AI assistants control LinkedIn accounts and retrieve real-time data.", "main": "dist/index.js", "bin": { diff --git a/src/tools/nv-search-people.ts b/src/tools/nv-search-people.ts index 6a49893..f9f759a 100644 --- a/src/tools/nv-search-people.ts +++ b/src/tools/nv-search-people.ts @@ -7,36 +7,42 @@ import { OperationTool } from '../utils/linked-api-tool.js'; export class NvSearchPeopleTool extends OperationTool { public override readonly name = 'nv_search_people'; public override readonly operationName = OPERATION_NAME.nvSearchPeople; - protected override readonly schema = z.object({ - term: z.string().optional(), - limit: z.number().min(1).max(2500).optional(), - filter: z - .object({ - firstName: z.string().optional(), - lastName: z.string().optional(), - position: z.string().optional(), - locations: z.array(z.string()).optional(), - industries: z.array(z.string()).optional(), - currentCompanies: z.array(z.string()).optional(), - previousCompanies: z.array(z.string()).optional(), - schools: z.array(z.string()).optional(), - yearsOfExperiences: z.array(z.string()).optional(), - connectionDegrees: z.array(z.enum(['1st', '2nd', '3rd+', 'groupMembers'])).optional(), - }) - .optional(), - }); + protected override readonly schema = z + .object({ + term: z.string().optional(), + limit: z.number().min(1).max(2500).optional(), + filter: z + .object({ + firstName: z.string().optional(), + lastName: z.string().optional(), + position: z.string().optional(), + locations: z.array(z.string()).optional(), + industries: z.array(z.string()).optional(), + currentCompanies: z.array(z.string()).optional(), + previousCompanies: z.array(z.string()).optional(), + schools: z.array(z.string()).optional(), + yearsOfExperiences: z.array(z.string()).optional(), + connectionDegrees: z.array(z.enum(['1st', '2nd', '3rd+', 'groupMembers'])).optional(), + }) + .optional(), + customSearchUrl: z.string().optional(), + }) + .refine(({ term, customSearchUrl }) => Boolean(term) || Boolean(customSearchUrl), { + message: 'Either term or customSearchUrl must be provided.', + }); public override getTool(): Tool { return { name: this.name, description: - 'Allows you to search people in Sales Navigator applying various filtering criteria. (nv.searchPeople action). Every person in the result carries urn — their permanent LinkedIn member URN (urn:li:member:), or null when LinkedIn does not expose it. The same person carries the same urn in standard interface results, so it can be used to match Sales Navigator results against them. Every person also carries viewerState.connectionDegree — your connection degree to them (1st, 2nd, 3rd+), or null when LinkedIn shows none.', + 'Allows you to search people in Sales Navigator applying various filtering criteria. (nv.searchPeople action). Either term or customSearchUrl must be provided. Every person in the result carries urn — their permanent LinkedIn member URN (urn:li:member:), or null when LinkedIn does not expose it. The same person carries the same urn in standard interface results, so it can be used to match Sales Navigator results against them. Every person also carries viewerState.connectionDegree — your connection degree to them (1st, 2nd, 3rd+), or null when LinkedIn shows none.', inputSchema: { type: 'object', properties: { term: { type: 'string', - description: 'Optional. Keyword or phrase to search.', + description: + 'Optional. Keyword or phrase to search. Required unless customSearchUrl is specified.', }, limit: { type: 'number', @@ -110,6 +116,11 @@ export class NvSearchPeopleTool extends OperationTool { public override readonly name = 'search_people'; public override readonly operationName = OPERATION_NAME.searchPeople; - protected override readonly schema = z.object({ - term: z.string().optional(), - limit: z.number().min(1).max(1000).optional(), - filter: z - .object({ - firstName: z.string().optional(), - lastName: z.string().optional(), - position: z.string().optional(), - locations: z.array(z.string()).optional(), - industries: z.array(z.string()).optional(), - currentCompanies: z.array(z.string()).optional(), - previousCompanies: z.array(z.string()).optional(), - schools: z.array(z.string()).optional(), - connectionDegrees: z.array(z.enum(['1st', '2nd', '3rd+'])).optional(), - }) - .optional(), - }); + protected override readonly schema = z + .object({ + term: z.string().optional(), + limit: z.number().min(1).max(1000).optional(), + filter: z + .object({ + firstName: z.string().optional(), + lastName: z.string().optional(), + position: z.string().optional(), + locations: z.array(z.string()).optional(), + industries: z.array(z.string()).optional(), + currentCompanies: z.array(z.string()).optional(), + previousCompanies: z.array(z.string()).optional(), + schools: z.array(z.string()).optional(), + connectionDegrees: z.array(z.enum(['1st', '2nd', '3rd+'])).optional(), + }) + .optional(), + customSearchUrl: z.string().optional(), + }) + .refine(({ term, customSearchUrl }) => Boolean(term) || Boolean(customSearchUrl), { + message: 'Either term or customSearchUrl must be provided.', + }); public override getTool(): Tool { return { name: this.name, description: - 'Allows you to search people applying various filtering criteria (st.searchPeople action). Every person in the result carries urn — their permanent LinkedIn member URN (urn:li:member:), or null when LinkedIn does not expose it. Every person also carries viewerState.connectionDegree — your connection degree to them (1st, 2nd, 3rd+), or null when LinkedIn shows none.', + 'Allows you to search people applying various filtering criteria (st.searchPeople action). Either term or customSearchUrl must be provided. Every person in the result carries urn — their permanent LinkedIn member URN (urn:li:member:), or null when LinkedIn does not expose it. Every person also carries viewerState.connectionDegree — your connection degree to them (1st, 2nd, 3rd+), or null when LinkedIn shows none.', inputSchema: { type: 'object', properties: { term: { type: 'string', - description: 'Optional. Keyword or phrase to search.', + description: + 'Optional. Keyword or phrase to search. Required unless customSearchUrl is specified.', }, limit: { type: 'number', @@ -100,6 +106,11 @@ export class SearchPeopleTool extends OperationTool