@linkedapi/mcp 0.3.11

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.
Files changed (212) hide show
  1. package/.dockerignore +11 -0
  2. package/.github/workflows/merge-main.yaml +136 -0
  3. package/.github/workflows/pr-main.yaml +42 -0
  4. package/.husky/pre-commit +5 -0
  5. package/.prettierrc.js +21 -0
  6. package/.vscode/launch.json +19 -0
  7. package/Dockerfile +39 -0
  8. package/LICENSE +21 -0
  9. package/README.md +17 -0
  10. package/dist/index.d.ts +3 -0
  11. package/dist/index.d.ts.map +1 -0
  12. package/dist/index.js +189 -0
  13. package/dist/index.js.map +1 -0
  14. package/dist/linked-api-server.d.ts +13 -0
  15. package/dist/linked-api-server.d.ts.map +1 -0
  16. package/dist/linked-api-server.js +127 -0
  17. package/dist/linked-api-server.js.map +1 -0
  18. package/dist/linked-api-tools.d.ts +8 -0
  19. package/dist/linked-api-tools.d.ts.map +1 -0
  20. package/dist/linked-api-tools.js +72 -0
  21. package/dist/linked-api-tools.js.map +1 -0
  22. package/dist/prompts/index.d.ts +10 -0
  23. package/dist/prompts/index.d.ts.map +1 -0
  24. package/dist/prompts/index.js +190 -0
  25. package/dist/prompts/index.js.map +1 -0
  26. package/dist/tools/check-connection-status.d.ts +13 -0
  27. package/dist/tools/check-connection-status.d.ts.map +1 -0
  28. package/dist/tools/check-connection-status.js +31 -0
  29. package/dist/tools/check-connection-status.js.map +1 -0
  30. package/dist/tools/comment-on-post.d.ts +15 -0
  31. package/dist/tools/comment-on-post.d.ts.map +1 -0
  32. package/dist/tools/comment-on-post.js +41 -0
  33. package/dist/tools/comment-on-post.js.map +1 -0
  34. package/dist/tools/create-post.d.ts +23 -0
  35. package/dist/tools/create-post.d.ts.map +1 -0
  36. package/dist/tools/create-post.js +67 -0
  37. package/dist/tools/create-post.js.map +1 -0
  38. package/dist/tools/execute-custom-workflow.d.ts +13 -0
  39. package/dist/tools/execute-custom-workflow.d.ts.map +1 -0
  40. package/dist/tools/execute-custom-workflow.js +26 -0
  41. package/dist/tools/execute-custom-workflow.js.map +1 -0
  42. package/dist/tools/fetch-company.d.ts +34 -0
  43. package/dist/tools/fetch-company.d.ts.map +1 -0
  44. package/dist/tools/fetch-company.js +139 -0
  45. package/dist/tools/fetch-company.js.map +1 -0
  46. package/dist/tools/fetch-person.d.ts +32 -0
  47. package/dist/tools/fetch-person.d.ts.map +1 -0
  48. package/dist/tools/fetch-person.js +129 -0
  49. package/dist/tools/fetch-person.js.map +1 -0
  50. package/dist/tools/fetch-post.d.ts +26 -0
  51. package/dist/tools/fetch-post.d.ts.map +1 -0
  52. package/dist/tools/fetch-post.js +82 -0
  53. package/dist/tools/fetch-post.js.map +1 -0
  54. package/dist/tools/get-api-usage-stats.d.ts +19 -0
  55. package/dist/tools/get-api-usage-stats.d.ts.map +1 -0
  56. package/dist/tools/get-api-usage-stats.js +40 -0
  57. package/dist/tools/get-api-usage-stats.js.map +1 -0
  58. package/dist/tools/get-conversation.d.ts +26 -0
  59. package/dist/tools/get-conversation.d.ts.map +1 -0
  60. package/dist/tools/get-conversation.js +59 -0
  61. package/dist/tools/get-conversation.js.map +1 -0
  62. package/dist/tools/get-workflow-result.d.ts +50 -0
  63. package/dist/tools/get-workflow-result.d.ts.map +1 -0
  64. package/dist/tools/get-workflow-result.js +46 -0
  65. package/dist/tools/get-workflow-result.js.map +1 -0
  66. package/dist/tools/nv-fetch-company.d.ts +30 -0
  67. package/dist/tools/nv-fetch-company.d.ts.map +1 -0
  68. package/dist/tools/nv-fetch-company.js +124 -0
  69. package/dist/tools/nv-fetch-company.js.map +1 -0
  70. package/dist/tools/nv-fetch-person.d.ts +13 -0
  71. package/dist/tools/nv-fetch-person.d.ts.map +1 -0
  72. package/dist/tools/nv-fetch-person.js +31 -0
  73. package/dist/tools/nv-fetch-person.js.map +1 -0
  74. package/dist/tools/nv-get-conversation.d.ts +26 -0
  75. package/dist/tools/nv-get-conversation.d.ts.map +1 -0
  76. package/dist/tools/nv-get-conversation.js +59 -0
  77. package/dist/tools/nv-get-conversation.js.map +1 -0
  78. package/dist/tools/nv-search-companies.d.ts +32 -0
  79. package/dist/tools/nv-search-companies.d.ts.map +1 -0
  80. package/dist/tools/nv-search-companies.js +106 -0
  81. package/dist/tools/nv-search-companies.js.map +1 -0
  82. package/dist/tools/nv-search-people.d.ts +25 -0
  83. package/dist/tools/nv-search-people.d.ts.map +1 -0
  84. package/dist/tools/nv-search-people.js +99 -0
  85. package/dist/tools/nv-search-people.js.map +1 -0
  86. package/dist/tools/nv-send-message.d.ts +15 -0
  87. package/dist/tools/nv-send-message.d.ts.map +1 -0
  88. package/dist/tools/nv-send-message.js +41 -0
  89. package/dist/tools/nv-send-message.js.map +1 -0
  90. package/dist/tools/nv-sync-conversation.d.ts +13 -0
  91. package/dist/tools/nv-sync-conversation.d.ts.map +1 -0
  92. package/dist/tools/nv-sync-conversation.js +31 -0
  93. package/dist/tools/nv-sync-conversation.js.map +1 -0
  94. package/dist/tools/react-to-post.d.ts +22 -0
  95. package/dist/tools/react-to-post.d.ts.map +1 -0
  96. package/dist/tools/react-to-post.js +42 -0
  97. package/dist/tools/react-to-post.js.map +1 -0
  98. package/dist/tools/remove-connection.d.ts +13 -0
  99. package/dist/tools/remove-connection.d.ts.map +1 -0
  100. package/dist/tools/remove-connection.js +31 -0
  101. package/dist/tools/remove-connection.js.map +1 -0
  102. package/dist/tools/retrieve-connections.d.ts +24 -0
  103. package/dist/tools/retrieve-connections.d.ts.map +1 -0
  104. package/dist/tools/retrieve-connections.js +90 -0
  105. package/dist/tools/retrieve-connections.js.map +1 -0
  106. package/dist/tools/retrieve-pending-requests.d.ts +10 -0
  107. package/dist/tools/retrieve-pending-requests.d.ts.map +1 -0
  108. package/dist/tools/retrieve-pending-requests.js +23 -0
  109. package/dist/tools/retrieve-pending-requests.js.map +1 -0
  110. package/dist/tools/retrieve-performance.d.ts +10 -0
  111. package/dist/tools/retrieve-performance.d.ts.map +1 -0
  112. package/dist/tools/retrieve-performance.js +23 -0
  113. package/dist/tools/retrieve-performance.js.map +1 -0
  114. package/dist/tools/retrieve-ssi.d.ts +10 -0
  115. package/dist/tools/retrieve-ssi.d.ts.map +1 -0
  116. package/dist/tools/retrieve-ssi.js +23 -0
  117. package/dist/tools/retrieve-ssi.js.map +1 -0
  118. package/dist/tools/search-companies.d.ts +28 -0
  119. package/dist/tools/search-companies.d.ts.map +1 -0
  120. package/dist/tools/search-companies.js +86 -0
  121. package/dist/tools/search-companies.js.map +1 -0
  122. package/dist/tools/search-people.d.ts +24 -0
  123. package/dist/tools/search-people.d.ts.map +1 -0
  124. package/dist/tools/search-people.js +90 -0
  125. package/dist/tools/search-people.js.map +1 -0
  126. package/dist/tools/send-connection-request.d.ts +15 -0
  127. package/dist/tools/send-connection-request.d.ts.map +1 -0
  128. package/dist/tools/send-connection-request.js +41 -0
  129. package/dist/tools/send-connection-request.js.map +1 -0
  130. package/dist/tools/send-message.d.ts +14 -0
  131. package/dist/tools/send-message.d.ts.map +1 -0
  132. package/dist/tools/send-message.js +36 -0
  133. package/dist/tools/send-message.js.map +1 -0
  134. package/dist/tools/sync-conversation.d.ts +13 -0
  135. package/dist/tools/sync-conversation.d.ts.map +1 -0
  136. package/dist/tools/sync-conversation.js +31 -0
  137. package/dist/tools/sync-conversation.js.map +1 -0
  138. package/dist/tools/withdraw-connection-request.d.ts +14 -0
  139. package/dist/tools/withdraw-connection-request.d.ts.map +1 -0
  140. package/dist/tools/withdraw-connection-request.js +36 -0
  141. package/dist/tools/withdraw-connection-request.js.map +1 -0
  142. package/dist/utils/define-request-timeout.d.ts +2 -0
  143. package/dist/utils/define-request-timeout.d.ts.map +1 -0
  144. package/dist/utils/define-request-timeout.js +20 -0
  145. package/dist/utils/define-request-timeout.js.map +1 -0
  146. package/dist/utils/execute-with-progress.d.ts +8 -0
  147. package/dist/utils/execute-with-progress.d.ts.map +1 -0
  148. package/dist/utils/execute-with-progress.js +75 -0
  149. package/dist/utils/execute-with-progress.js.map +1 -0
  150. package/dist/utils/handle-linked-api-error.d.ts +3 -0
  151. package/dist/utils/handle-linked-api-error.d.ts.map +1 -0
  152. package/dist/utils/handle-linked-api-error.js +29 -0
  153. package/dist/utils/handle-linked-api-error.js.map +1 -0
  154. package/dist/utils/json-http-transport.d.ts +26 -0
  155. package/dist/utils/json-http-transport.d.ts.map +1 -0
  156. package/dist/utils/json-http-transport.js +265 -0
  157. package/dist/utils/json-http-transport.js.map +1 -0
  158. package/dist/utils/linked-api-tool.d.ts +28 -0
  159. package/dist/utils/linked-api-tool.d.ts.map +1 -0
  160. package/dist/utils/linked-api-tool.js +25 -0
  161. package/dist/utils/linked-api-tool.js.map +1 -0
  162. package/dist/utils/logger.d.ts +8 -0
  163. package/dist/utils/logger.d.ts.map +1 -0
  164. package/dist/utils/logger.js +81 -0
  165. package/dist/utils/logger.js.map +1 -0
  166. package/dist/utils/types.d.ts +16 -0
  167. package/dist/utils/types.d.ts.map +1 -0
  168. package/dist/utils/types.js +3 -0
  169. package/dist/utils/types.js.map +1 -0
  170. package/eslint.config.js +118 -0
  171. package/package.json +62 -0
  172. package/src/index.ts +212 -0
  173. package/src/linked-api-server.ts +159 -0
  174. package/src/linked-api-tools.ts +72 -0
  175. package/src/prompts/index.ts +190 -0
  176. package/src/tools/check-connection-status.ts +39 -0
  177. package/src/tools/comment-on-post.ts +42 -0
  178. package/src/tools/create-post.ts +71 -0
  179. package/src/tools/execute-custom-workflow.ts +28 -0
  180. package/src/tools/fetch-company.ts +154 -0
  181. package/src/tools/fetch-person.ts +145 -0
  182. package/src/tools/fetch-post.ts +90 -0
  183. package/src/tools/get-api-usage-stats.ts +48 -0
  184. package/src/tools/get-conversation.ts +76 -0
  185. package/src/tools/get-workflow-result.ts +62 -0
  186. package/src/tools/nv-fetch-company.ts +136 -0
  187. package/src/tools/nv-fetch-person.ts +31 -0
  188. package/src/tools/nv-get-conversation.ts +76 -0
  189. package/src/tools/nv-search-companies.ts +114 -0
  190. package/src/tools/nv-search-people.ts +107 -0
  191. package/src/tools/nv-send-message.ts +42 -0
  192. package/src/tools/nv-sync-conversation.ts +32 -0
  193. package/src/tools/react-to-post.ts +44 -0
  194. package/src/tools/remove-connection.ts +32 -0
  195. package/src/tools/retrieve-connections.ts +105 -0
  196. package/src/tools/retrieve-pending-requests.ts +23 -0
  197. package/src/tools/retrieve-performance.ts +23 -0
  198. package/src/tools/retrieve-ssi.ts +23 -0
  199. package/src/tools/search-companies.ts +93 -0
  200. package/src/tools/search-people.ts +97 -0
  201. package/src/tools/send-connection-request.ts +46 -0
  202. package/src/tools/send-message.ts +36 -0
  203. package/src/tools/sync-conversation.ts +32 -0
  204. package/src/tools/withdraw-connection-request.ts +41 -0
  205. package/src/utils/define-request-timeout.ts +17 -0
  206. package/src/utils/execute-with-progress.ts +93 -0
  207. package/src/utils/handle-linked-api-error.ts +27 -0
  208. package/src/utils/json-http-transport.ts +325 -0
  209. package/src/utils/linked-api-tool.ts +58 -0
  210. package/src/utils/logger.ts +84 -0
  211. package/src/utils/types.ts +17 -0
  212. package/tsconfig.json +36 -0
@@ -0,0 +1,44 @@
1
+ import { OPERATION_NAME, TReactToPostParams } from '@linkedapi/node';
2
+ import { Tool } from '@modelcontextprotocol/sdk/types.js';
3
+ import { z } from 'zod';
4
+
5
+ import { OperationTool } from '../utils/linked-api-tool.js';
6
+
7
+ export class ReactToPostTool extends OperationTool<TReactToPostParams, unknown> {
8
+ public override readonly name = 'react_to_post';
9
+ public override readonly operationName = OPERATION_NAME.reactToPost;
10
+ protected override readonly schema = z.object({
11
+ postUrl: z.string(),
12
+ type: z.enum(['like', 'love', 'celebrate', 'support', 'funny', 'insightful']).or(z.string()),
13
+ companyUrl: z.string().optional(),
14
+ });
15
+
16
+ public override getTool(): Tool {
17
+ return {
18
+ name: this.name,
19
+ description:
20
+ 'Allows you to react to a post using any available reaction type (st.reactToPost action).',
21
+ inputSchema: {
22
+ type: 'object',
23
+ properties: {
24
+ postUrl: {
25
+ type: 'string',
26
+ description:
27
+ "LinkedIn URL of the post to react. (e.g., 'https://www.linkedin.com/posts/username_activity-id')",
28
+ },
29
+ type: {
30
+ type: 'string',
31
+ description: 'Enum describing the reaction type.',
32
+ enum: ['like', 'love', 'support', 'celebrate', 'insightful', 'funny'],
33
+ },
34
+ companyUrl: {
35
+ type: 'string',
36
+ description:
37
+ "LinkedIn company page URL. If specified, the reaction will be added on behalf of the company. (e.g., 'https://www.linkedin.com/company/acme-corp')",
38
+ },
39
+ },
40
+ required: ['postUrl', 'type'],
41
+ },
42
+ };
43
+ }
44
+ }
@@ -0,0 +1,32 @@
1
+ import { OPERATION_NAME, TRemoveConnectionParams } from '@linkedapi/node';
2
+ import { Tool } from '@modelcontextprotocol/sdk/types.js';
3
+ import { z } from 'zod';
4
+
5
+ import { OperationTool } from '../utils/linked-api-tool.js';
6
+
7
+ export class RemoveConnectionTool extends OperationTool<TRemoveConnectionParams, unknown> {
8
+ public override readonly name = 'remove_connection';
9
+ public override readonly operationName = OPERATION_NAME.removeConnection;
10
+ protected override readonly schema = z.object({
11
+ personUrl: z.string(),
12
+ });
13
+
14
+ public override getTool(): Tool {
15
+ return {
16
+ name: this.name,
17
+ description:
18
+ 'Allows you to remove a person from your connections (st.removeConnection action).',
19
+ inputSchema: {
20
+ type: 'object',
21
+ properties: {
22
+ personUrl: {
23
+ type: 'string',
24
+ description:
25
+ "Public or hashed LinkedIn URL of the person you want to remove from your connections. (e.g., 'https://www.linkedin.com/in/john-doe')",
26
+ },
27
+ },
28
+ required: ['personUrl'],
29
+ },
30
+ };
31
+ }
32
+ }
@@ -0,0 +1,105 @@
1
+ import {
2
+ OPERATION_NAME,
3
+ TRetrieveConnectionsParams,
4
+ TRetrieveConnectionsResult,
5
+ } from '@linkedapi/node';
6
+ import { Tool } from '@modelcontextprotocol/sdk/types.js';
7
+ import { z } from 'zod';
8
+
9
+ import { OperationTool } from '../utils/linked-api-tool.js';
10
+
11
+ export class RetrieveConnectionsTool extends OperationTool<
12
+ TRetrieveConnectionsParams,
13
+ TRetrieveConnectionsResult[]
14
+ > {
15
+ public override readonly name = 'retrieve_connections';
16
+ public override readonly operationName = OPERATION_NAME.retrieveConnections;
17
+ protected override readonly schema = z.object({
18
+ limit: z.number().min(1).max(1000).optional(),
19
+ since: z.string().optional(),
20
+ filter: z
21
+ .object({
22
+ firstName: z.string().optional(),
23
+ lastName: z.string().optional(),
24
+ position: z.string().optional(),
25
+ locations: z.array(z.string()).optional(),
26
+ industries: z.array(z.string()).optional(),
27
+ currentCompanies: z.array(z.string()).optional(),
28
+ previousCompanies: z.array(z.string()).optional(),
29
+ schools: z.array(z.string()).optional(),
30
+ })
31
+ .optional(),
32
+ });
33
+
34
+ public override getTool(): Tool {
35
+ return {
36
+ name: this.name,
37
+ description:
38
+ 'allows you to retrieve your connections and perform additional person-related actions if needed (st.retrieveConnections action).',
39
+ inputSchema: {
40
+ type: 'object',
41
+ properties: {
42
+ limit: {
43
+ type: 'number',
44
+ description:
45
+ 'Optional. Number of connections to return. Defaults to 10, with a maximum value of 1000.',
46
+ },
47
+ since: {
48
+ type: 'string',
49
+ description:
50
+ 'Optional. ISO date string that filters connections to only include those made on or after the specified date. Only works when filter is not provided.',
51
+ },
52
+ filter: {
53
+ type: 'object',
54
+ description:
55
+ 'Optional. Object that specifies filtering criteria for people. When multiple filter fields are specified, they are combined using AND logic.',
56
+ properties: {
57
+ firstName: {
58
+ type: 'string',
59
+ description: 'Optional. First name of person.',
60
+ },
61
+ lastName: {
62
+ type: 'string',
63
+ description: 'Optional. Last name of person.',
64
+ },
65
+ position: {
66
+ type: 'string',
67
+ description: 'Optional. Job position of person.',
68
+ },
69
+ locations: {
70
+ type: 'array',
71
+ description:
72
+ 'Optional. Array of free-form strings representing locations. Matches if person is located in any of the listed locations.',
73
+ items: { type: 'string' },
74
+ },
75
+ industries: {
76
+ type: 'array',
77
+ description:
78
+ 'Optional. Array of enums representing industries. Matches if person works in any of the listed industries. Takes specific values available in the LinkedIn interface.',
79
+ items: { type: 'string' },
80
+ },
81
+ currentCompanies: {
82
+ type: 'array',
83
+ description:
84
+ 'Optional. Array of company names. Matches if person currently works at any of the listed companies.',
85
+ items: { type: 'string' },
86
+ },
87
+ previousCompanies: {
88
+ type: 'array',
89
+ description:
90
+ 'Optional. Array of company names. Matches if person previously worked at any of the listed companies.',
91
+ items: { type: 'string' },
92
+ },
93
+ schools: {
94
+ type: 'array',
95
+ description:
96
+ 'Optional. Array of institution names. Matches if person currently attends or previously attended any of the listed institutions.',
97
+ items: { type: 'string' },
98
+ },
99
+ },
100
+ },
101
+ },
102
+ },
103
+ };
104
+ }
105
+ }
@@ -0,0 +1,23 @@
1
+ import { OPERATION_NAME } from '@linkedapi/node';
2
+ import { Tool } from '@modelcontextprotocol/sdk/types.js';
3
+ import { z } from 'zod';
4
+
5
+ import { OperationTool } from '../utils/linked-api-tool.js';
6
+
7
+ export class RetrievePendingRequestsTool extends OperationTool<unknown, unknown> {
8
+ public override readonly name = 'retrieve_pending_requests';
9
+ public override readonly operationName = OPERATION_NAME.retrievePendingRequests;
10
+ protected override readonly schema = z.object({});
11
+
12
+ public override getTool(): Tool {
13
+ return {
14
+ name: this.name,
15
+ description:
16
+ 'Allows you to retrieve pending connection requests sent from your account. (st.retrievePendingRequests action).',
17
+ inputSchema: {
18
+ type: 'object',
19
+ properties: {},
20
+ },
21
+ };
22
+ }
23
+ }
@@ -0,0 +1,23 @@
1
+ import { OPERATION_NAME } from '@linkedapi/node';
2
+ import { Tool } from '@modelcontextprotocol/sdk/types.js';
3
+ import { z } from 'zod';
4
+
5
+ import { OperationTool } from '../utils/linked-api-tool.js';
6
+
7
+ export class RetrievePerformanceTool extends OperationTool<unknown, unknown> {
8
+ public override readonly name = 'retrieve_performance';
9
+ public override readonly operationName = OPERATION_NAME.retrievePerformance;
10
+ protected override readonly schema = z.object({});
11
+
12
+ public override getTool(): Tool {
13
+ return {
14
+ name: this.name,
15
+ description:
16
+ 'Allows you to retrieve performance analytics from your LinkedIn dashboard (st.retrievePerformance action).',
17
+ inputSchema: {
18
+ type: 'object',
19
+ properties: {},
20
+ },
21
+ };
22
+ }
23
+ }
@@ -0,0 +1,23 @@
1
+ import { OPERATION_NAME } from '@linkedapi/node';
2
+ import { Tool } from '@modelcontextprotocol/sdk/types.js';
3
+ import { z } from 'zod';
4
+
5
+ import { OperationTool } from '../utils/linked-api-tool.js';
6
+
7
+ export class RetrieveSSITool extends OperationTool<unknown, unknown> {
8
+ public override readonly operationName = OPERATION_NAME.retrieveSSI;
9
+ public override readonly name = 'retrieve_ssi';
10
+ protected override readonly schema = z.object({});
11
+
12
+ public override getTool(): Tool {
13
+ return {
14
+ name: this.name,
15
+ description:
16
+ 'Allows you to retrieve your current SSI (Social Selling Index) (st.retrieveSSI action).',
17
+ inputSchema: {
18
+ type: 'object',
19
+ properties: {},
20
+ },
21
+ };
22
+ }
23
+ }
@@ -0,0 +1,93 @@
1
+ import { OPERATION_NAME, TSearchCompaniesParams } from '@linkedapi/node';
2
+ import { Tool } from '@modelcontextprotocol/sdk/types.js';
3
+ import { z } from 'zod';
4
+
5
+ import { OperationTool } from '../utils/linked-api-tool.js';
6
+
7
+ export class SearchCompaniesTool extends OperationTool<TSearchCompaniesParams, unknown> {
8
+ public override readonly name = 'search_companies';
9
+ public override readonly operationName = OPERATION_NAME.searchCompanies;
10
+ protected override readonly schema = z.object({
11
+ term: z.string().optional(),
12
+ limit: z.number().min(1).max(1000).optional(),
13
+ filter: z
14
+ .object({
15
+ locations: z.array(z.string()).optional(),
16
+ industries: z.array(z.string()).optional(),
17
+ sizes: z
18
+ .array(
19
+ z.enum([
20
+ '1-10',
21
+ '11-50',
22
+ '51-200',
23
+ '201-500',
24
+ '501-1000',
25
+ '1001-5000',
26
+ '5001-10000',
27
+ '10001+',
28
+ ]),
29
+ )
30
+ .optional(),
31
+ })
32
+ .optional(),
33
+ });
34
+
35
+ public override getTool(): Tool {
36
+ return {
37
+ name: this.name,
38
+ description:
39
+ 'Allows you to search for companies applying various filtering criteria (st.searchCompanies action).',
40
+ inputSchema: {
41
+ type: 'object',
42
+ properties: {
43
+ term: {
44
+ type: 'string',
45
+ description: 'Optional. Keyword or phrase to search.',
46
+ },
47
+ limit: {
48
+ type: 'number',
49
+ description:
50
+ 'Optional. Number of search results to return. Defaults to 10, with a maximum value of 1000.',
51
+ },
52
+ filter: {
53
+ type: 'object',
54
+ description:
55
+ 'Optional. Object that specifies filtering criteria for companies. When multiple filter fields are specified, they are combined using AND logic.',
56
+ properties: {
57
+ sizes: {
58
+ type: 'array',
59
+ description:
60
+ 'Optional. Array of enums representing employee count ranges. Matches if company size falls within any of the listed ranges.',
61
+ items: {
62
+ type: 'string',
63
+ enum: [
64
+ '1-10',
65
+ '11-50',
66
+ '51-200',
67
+ '201-500',
68
+ '501-1000',
69
+ '1001-5000',
70
+ '5001-10000',
71
+ '10001+',
72
+ ],
73
+ },
74
+ },
75
+ locations: {
76
+ type: 'array',
77
+ description:
78
+ 'Optional. Array of free-form strings representing locations. Matches if company is headquartered in any of the listed locations.',
79
+ items: { type: 'string' },
80
+ },
81
+ industries: {
82
+ type: 'array',
83
+ description:
84
+ 'Optional. Array of enums representing industries. Matches if company works in any of the listed industries. Takes specific values available in the LinkedIn interface.',
85
+ items: { type: 'string' },
86
+ },
87
+ },
88
+ },
89
+ },
90
+ },
91
+ };
92
+ }
93
+ }
@@ -0,0 +1,97 @@
1
+ import { OPERATION_NAME, TSearchPeopleParams } from '@linkedapi/node';
2
+ import { Tool } from '@modelcontextprotocol/sdk/types.js';
3
+ import { z } from 'zod';
4
+
5
+ import { OperationTool } from '../utils/linked-api-tool.js';
6
+
7
+ export class SearchPeopleTool extends OperationTool<TSearchPeopleParams, unknown> {
8
+ public override readonly name = 'search_people';
9
+ public override readonly operationName = OPERATION_NAME.searchPeople;
10
+ protected override readonly schema = z.object({
11
+ term: z.string().optional(),
12
+ limit: z.number().min(1).max(1000).optional(),
13
+ filter: z
14
+ .object({
15
+ firstName: z.string().optional(),
16
+ lastName: z.string().optional(),
17
+ position: z.string().optional(),
18
+ locations: z.array(z.string()).optional(),
19
+ industries: z.array(z.string()).optional(),
20
+ currentCompanies: z.array(z.string()).optional(),
21
+ previousCompanies: z.array(z.string()).optional(),
22
+ schools: z.array(z.string()).optional(),
23
+ })
24
+ .optional(),
25
+ });
26
+
27
+ public override getTool(): Tool {
28
+ return {
29
+ name: this.name,
30
+ description:
31
+ 'Allows you to search people applying various filtering criteria (st.searchPeople action).',
32
+ inputSchema: {
33
+ type: 'object',
34
+ properties: {
35
+ term: {
36
+ type: 'string',
37
+ description: 'Optional. Keyword or phrase to search.',
38
+ },
39
+ limit: {
40
+ type: 'number',
41
+ description:
42
+ 'Optional. Number of search results to return. Defaults to 10, with a maximum value of 1000.',
43
+ },
44
+ filter: {
45
+ type: 'object',
46
+ description:
47
+ 'Optional. Object that specifies filtering criteria for people. When multiple filter fields are specified, they are combined using AND logic.',
48
+ properties: {
49
+ firstName: {
50
+ type: 'string',
51
+ description: 'Optional. First name of person.',
52
+ },
53
+ lastName: {
54
+ type: 'string',
55
+ description: 'Optional. Last name of person.',
56
+ },
57
+ position: {
58
+ type: 'string',
59
+ description: 'Optional. Job position of person.',
60
+ },
61
+ locations: {
62
+ type: 'array',
63
+ description:
64
+ 'Optional. Array of free-form strings representing locations. Matches if person is located in any of the listed locations.',
65
+ items: { type: 'string' },
66
+ },
67
+ industries: {
68
+ type: 'array',
69
+ description:
70
+ 'Optional. Array of enums representing industries. Matches if person works in any of the listed industries. Takes specific values available in the LinkedIn interface.',
71
+ items: { type: 'string' },
72
+ },
73
+ currentCompanies: {
74
+ type: 'array',
75
+ description:
76
+ 'Optional. Array of company names. Matches if person currently works at any of the listed companies.',
77
+ items: { type: 'string' },
78
+ },
79
+ previousCompanies: {
80
+ type: 'array',
81
+ description:
82
+ 'Optional. Array of company names. Matches if person previously worked at any of the listed companies.',
83
+ items: { type: 'string' },
84
+ },
85
+ schools: {
86
+ type: 'array',
87
+ description:
88
+ 'Optional. Array of institution names. Matches if person currently attends or previously attended any of the listed institutions.',
89
+ items: { type: 'string' },
90
+ },
91
+ },
92
+ },
93
+ },
94
+ },
95
+ };
96
+ }
97
+ }
@@ -0,0 +1,46 @@
1
+ import { OPERATION_NAME, TSendConnectionRequestParams } from '@linkedapi/node';
2
+ import { Tool } from '@modelcontextprotocol/sdk/types.js';
3
+ import { z } from 'zod';
4
+
5
+ import { OperationTool } from '../utils/linked-api-tool.js';
6
+
7
+ export class SendConnectionRequestTool extends OperationTool<
8
+ TSendConnectionRequestParams,
9
+ unknown
10
+ > {
11
+ public override readonly name = 'send_connection_request';
12
+ public override readonly operationName = OPERATION_NAME.sendConnectionRequest;
13
+ protected override readonly schema = z.object({
14
+ personUrl: z.string(),
15
+ note: z.string().optional(),
16
+ email: z.string().optional(),
17
+ });
18
+
19
+ public override getTool(): Tool {
20
+ return {
21
+ name: this.name,
22
+ description:
23
+ 'Allows you to send a connection request to a person (st.sendConnectionRequest action).',
24
+ inputSchema: {
25
+ type: 'object',
26
+ properties: {
27
+ personUrl: {
28
+ type: 'string',
29
+ description:
30
+ "Public or hashed LinkedIn URL of the person you want to send a connection request to. (e.g., 'https://www.linkedin.com/in/john-doe')",
31
+ },
32
+ note: {
33
+ type: 'string',
34
+ description: 'Optional. Note to include with the connection request.',
35
+ },
36
+ email: {
37
+ type: 'string',
38
+ description:
39
+ 'Optional. Email address required by some people for sending connection requests to them. If it is required and not provided, the connection request will fail.',
40
+ },
41
+ },
42
+ required: ['personUrl'],
43
+ },
44
+ };
45
+ }
46
+ }
@@ -0,0 +1,36 @@
1
+ import { OPERATION_NAME, TSendMessageParams } from '@linkedapi/node';
2
+ import { Tool } from '@modelcontextprotocol/sdk/types.js';
3
+ import { z } from 'zod';
4
+
5
+ import { OperationTool } from '../utils/linked-api-tool.js';
6
+
7
+ export class SendMessageTool extends OperationTool<TSendMessageParams, unknown> {
8
+ public override readonly name = 'send_message';
9
+ public override readonly operationName = OPERATION_NAME.sendMessage;
10
+ protected override readonly schema = z.object({
11
+ personUrl: z.string(),
12
+ text: z.string().min(1),
13
+ });
14
+
15
+ public override getTool(): Tool {
16
+ return {
17
+ name: this.name,
18
+ description: 'Allows you to send a message to a person (st.sendMessage action).',
19
+ inputSchema: {
20
+ type: 'object',
21
+ properties: {
22
+ personUrl: {
23
+ type: 'string',
24
+ description:
25
+ "LinkedIn URL of the person you want to send a message to (e.g., 'https://www.linkedin.com/in/john-doe')",
26
+ },
27
+ text: {
28
+ type: 'string',
29
+ description: 'The message text, must be up to 1900 characters.',
30
+ },
31
+ },
32
+ required: ['personUrl', 'text'],
33
+ },
34
+ };
35
+ }
36
+ }
@@ -0,0 +1,32 @@
1
+ import { OPERATION_NAME, TSyncConversationParams } from '@linkedapi/node';
2
+ import { Tool } from '@modelcontextprotocol/sdk/types.js';
3
+ import { z } from 'zod';
4
+
5
+ import { OperationTool } from '../utils/linked-api-tool.js';
6
+
7
+ export class SyncConversationTool extends OperationTool<TSyncConversationParams, unknown> {
8
+ public override readonly name = 'sync_conversation';
9
+ public override readonly operationName = OPERATION_NAME.syncConversation;
10
+ protected override readonly schema = z.object({
11
+ personUrl: z.string(),
12
+ });
13
+
14
+ public override getTool(): Tool {
15
+ return {
16
+ name: this.name,
17
+ description:
18
+ 'Allows you to sync a conversation so you can start polling it (st.syncConversation action).',
19
+ inputSchema: {
20
+ type: 'object',
21
+ properties: {
22
+ personUrl: {
23
+ type: 'string',
24
+ description:
25
+ "The LinkedIn URL of the person whose conversation you want to synchronize (e.g., 'https://www.linkedin.com/in/john-doe')",
26
+ },
27
+ },
28
+ required: ['personUrl'],
29
+ },
30
+ };
31
+ }
32
+ }
@@ -0,0 +1,41 @@
1
+ import { OPERATION_NAME, TWithdrawConnectionRequestParams } from '@linkedapi/node';
2
+ import { Tool } from '@modelcontextprotocol/sdk/types.js';
3
+ import { z } from 'zod';
4
+
5
+ import { OperationTool } from '../utils/linked-api-tool.js';
6
+
7
+ export class WithdrawConnectionRequestTool extends OperationTool<
8
+ TWithdrawConnectionRequestParams,
9
+ unknown
10
+ > {
11
+ public override readonly name = 'withdraw_connection_request';
12
+ public override readonly operationName = OPERATION_NAME.withdrawConnectionRequest;
13
+ protected override readonly schema = z.object({
14
+ personUrl: z.string(),
15
+ unfollow: z.boolean().optional(),
16
+ });
17
+
18
+ public override getTool(): Tool {
19
+ return {
20
+ name: this.name,
21
+ description:
22
+ 'Allows you to withdraw the connection request sent to a person (st.withdrawConnectionRequest action).',
23
+ inputSchema: {
24
+ type: 'object',
25
+ properties: {
26
+ personUrl: {
27
+ type: 'string',
28
+ description:
29
+ "Public or hashed LinkedIn URL of the person you want to withdraw the connection request from. (e.g., 'https://www.linkedin.com/in/john-doe')",
30
+ },
31
+ unfollow: {
32
+ type: 'boolean',
33
+ description:
34
+ 'Optional. Boolean indicating whether you want to unfollow the person when withdrawing the request. The default value is true.',
35
+ },
36
+ },
37
+ required: ['personUrl'],
38
+ },
39
+ };
40
+ }
41
+ }
@@ -0,0 +1,17 @@
1
+ export function defineRequestTimeoutInSeconds(mcpClient: string): number {
2
+ const bigTimeout = 600;
3
+
4
+ console.error('mcpClient', mcpClient);
5
+ switch (mcpClient) {
6
+ case 'claude':
7
+ return 180;
8
+ case 'chatgpt':
9
+ return 50;
10
+ case 'cursor':
11
+ case 'vscode':
12
+ case 'windsurf':
13
+ return bigTimeout;
14
+ default:
15
+ return 60;
16
+ }
17
+ }