Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
51 changes: 31 additions & 20 deletions src/tools/nv-search-people.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,42 @@ import { OperationTool } from '../utils/linked-api-tool.js';
export class NvSearchPeopleTool extends OperationTool<TNvSearchPeopleParams, unknown> {
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:<id>), 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:<id>), 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',
Expand Down Expand Up @@ -110,6 +116,11 @@ export class NvSearchPeopleTool extends OperationTool<TNvSearchPeopleParams, unk
},
},
},
customSearchUrl: {
type: 'string',
description:
'Optional. URL copied from a Sales Navigator people search page (linkedin.com/sales/search/people/...). When specified, overrides term and filter.',
},
},
},
};
Expand Down
49 changes: 30 additions & 19 deletions src/tools/search-people.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,41 @@ import { OperationTool } from '../utils/linked-api-tool.js';
export class SearchPeopleTool extends OperationTool<TSearchPeopleParams, unknown> {
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:<id>), 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:<id>), 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',
Expand Down Expand Up @@ -100,6 +106,11 @@ export class SearchPeopleTool extends OperationTool<TSearchPeopleParams, unknown
},
},
},
customSearchUrl: {
type: 'string',
description:
'Optional. URL copied from a LinkedIn people search page (linkedin.com/search/results/people/...), such as the searchUrl of an anonymous viewer from retrieve_profile_viewers. When specified, overrides term and filter.',
},
},
},
};
Expand Down
2 changes: 1 addition & 1 deletion src/tools/withdraw-connection-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class WithdrawConnectionRequestTool extends OperationTool<
public override readonly operationName = OPERATION_NAME.withdrawConnectionRequest;
protected override readonly schema = z.object({
personUrl: z.string(),
unfollow: z.boolean().optional(),
unfollow: z.boolean().optional().default(true),
});

public override getTool(): Tool {
Expand Down
Loading