@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,39 @@
1
+ import {
2
+ OPERATION_NAME,
3
+ TCheckConnectionStatusParams,
4
+ TCheckConnectionStatusResult,
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 CheckConnectionStatusTool extends OperationTool<
12
+ TCheckConnectionStatusParams,
13
+ TCheckConnectionStatusResult
14
+ > {
15
+ public override readonly name = 'check_connection_status';
16
+ public override readonly operationName = OPERATION_NAME.checkConnectionStatus;
17
+ protected override readonly schema = z.object({
18
+ personUrl: z.string(),
19
+ });
20
+
21
+ public override getTool(): Tool {
22
+ return {
23
+ name: this.name,
24
+ description:
25
+ 'Allows you to check the connection status between your account and another person (st.checkConnectionStatus action).',
26
+ inputSchema: {
27
+ type: 'object',
28
+ properties: {
29
+ personUrl: {
30
+ type: 'string',
31
+ description:
32
+ "Public or hashed LinkedIn URL of the person you want to check the connection status with. (e.g., 'https://www.linkedin.com/in/john-doe')",
33
+ },
34
+ },
35
+ required: ['personUrl'],
36
+ },
37
+ };
38
+ }
39
+ }
@@ -0,0 +1,42 @@
1
+ import { OPERATION_NAME, TCommentOnPostParams } 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 CommentOnPostTool extends OperationTool<TCommentOnPostParams, unknown> {
8
+ public override readonly name = 'comment_on_post';
9
+ public override readonly operationName = OPERATION_NAME.commentOnPost;
10
+ protected override readonly schema = z.object({
11
+ postUrl: z.string(),
12
+ text: z.string().min(1),
13
+ companyUrl: z.string().optional(),
14
+ });
15
+
16
+ public override getTool(): Tool {
17
+ return {
18
+ name: this.name,
19
+ description: 'Allows you to leave a comment on a post (st.commentOnPost action).',
20
+ inputSchema: {
21
+ type: 'object',
22
+ properties: {
23
+ postUrl: {
24
+ type: 'string',
25
+ description:
26
+ "The LinkedIn post URL to comment on (e.g., 'https://www.linkedin.com/posts/username_activity-id')",
27
+ },
28
+ text: {
29
+ type: 'string',
30
+ description: 'Comment text, must be up to 1000 characters.',
31
+ },
32
+ companyUrl: {
33
+ type: 'string',
34
+ description:
35
+ "LinkedIn company page URL. If specified, the comment will be added on behalf of the company. (e.g., 'https://www.linkedin.com/company/acme-corp')",
36
+ },
37
+ },
38
+ required: ['postUrl', 'text'],
39
+ },
40
+ };
41
+ }
42
+ }
@@ -0,0 +1,71 @@
1
+ import { OPERATION_NAME, TCreatePostParams } 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 CreatePostTool extends OperationTool<TCreatePostParams, unknown> {
8
+ public override readonly name = 'create_post';
9
+ public override readonly operationName = OPERATION_NAME.createPost;
10
+ protected override readonly schema = z.object({
11
+ text: z.string().min(1).max(3000),
12
+ companyUrl: z.string().optional(),
13
+ attachments: z
14
+ .array(
15
+ z.object({
16
+ url: z.string(),
17
+ type: z.enum(['image', 'video', 'document']),
18
+ name: z.string().optional(),
19
+ }),
20
+ )
21
+ .max(9)
22
+ .optional(),
23
+ });
24
+
25
+ public override getTool(): Tool {
26
+ return {
27
+ name: this.name,
28
+ description:
29
+ 'Creates a new LinkedIn post with optional media attachments (st.createPost action).',
30
+ inputSchema: {
31
+ type: 'object',
32
+ properties: {
33
+ text: {
34
+ type: 'string',
35
+ description: 'Post content, must be up to 3000 characters.',
36
+ },
37
+ companyUrl: {
38
+ type: 'string',
39
+ description:
40
+ 'LinkedIn company page URL. If specified, the post will be created on the company page (requires admin access).',
41
+ },
42
+ attachments: {
43
+ type: 'array',
44
+ description:
45
+ 'Media attachments for the post. You can add up to 9 images, or 1 video, or 1 document. Cannot mix different attachment types.',
46
+ items: {
47
+ type: 'object',
48
+ properties: {
49
+ url: {
50
+ type: 'string',
51
+ description: 'Publicly accessible URL of the media file.',
52
+ },
53
+ type: {
54
+ type: 'string',
55
+ enum: ['image', 'video', 'document'],
56
+ description: 'Type of media attachment.',
57
+ },
58
+ name: {
59
+ type: 'string',
60
+ description: 'Display name for the document (required for documents).',
61
+ },
62
+ },
63
+ required: ['url', 'type'],
64
+ },
65
+ },
66
+ },
67
+ required: ['text'],
68
+ },
69
+ };
70
+ }
71
+ }
@@ -0,0 +1,28 @@
1
+ import { OPERATION_NAME, TWorkflowCompletion, TWorkflowDefinition } 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 ExecuteCustomWorkflowTool extends OperationTool<
8
+ TWorkflowDefinition,
9
+ TWorkflowCompletion
10
+ > {
11
+ public override readonly name = 'execute_custom_workflow';
12
+ public override readonly operationName = OPERATION_NAME.customWorkflow;
13
+ protected override readonly schema = z.object({
14
+ definition: z.any(),
15
+ });
16
+
17
+ public override getTool(): Tool {
18
+ return {
19
+ name: this.name,
20
+ description: 'Execute a custom workflow definition',
21
+ inputSchema: {
22
+ type: 'object',
23
+ properties: { definition: { type: 'object' } },
24
+ required: ['definition'],
25
+ },
26
+ };
27
+ }
28
+ }
@@ -0,0 +1,154 @@
1
+ import { OPERATION_NAME, TFetchCompanyParams } 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 FetchCompanyTool extends OperationTool<TFetchCompanyParams, unknown> {
8
+ public override readonly name = 'fetch_company';
9
+ public override readonly operationName = OPERATION_NAME.fetchCompany;
10
+ protected override readonly schema = z.object({
11
+ companyUrl: z.string(),
12
+ retrieveEmployees: z.boolean().optional().default(false),
13
+ retrievePosts: z.boolean().optional().default(false),
14
+ retrieveDMs: z.boolean().optional().default(false),
15
+ postsRetrievalConfig: z
16
+ .object({
17
+ limit: z.number().min(1).max(20).optional(),
18
+ since: z.string().optional(),
19
+ })
20
+ .optional(),
21
+ dmsRetrievalConfig: z
22
+ .object({
23
+ limit: z.number().min(1).max(20).optional(),
24
+ })
25
+ .optional(),
26
+ employeesRetrievalConfig: z
27
+ .object({
28
+ limit: z.number().min(1).max(500).optional(),
29
+ filter: z
30
+ .object({
31
+ firstName: z.string().optional(),
32
+ lastName: z.string().optional(),
33
+ position: z.string().optional(),
34
+ locations: z.array(z.string()).optional(),
35
+ industries: z.array(z.string()).optional(),
36
+ schools: z.array(z.string()).optional(),
37
+ })
38
+ .optional(),
39
+ })
40
+ .optional(),
41
+ });
42
+
43
+ public override getTool(): Tool {
44
+ return {
45
+ name: this.name,
46
+ description:
47
+ 'Allows you to open a company page to retrieve its basic information (st.openCompanyPage action). Can optionally retrieve employees, posts and decision makers.',
48
+ inputSchema: {
49
+ type: 'object',
50
+ properties: {
51
+ companyUrl: {
52
+ type: 'string',
53
+ description:
54
+ "Public or hashed LinkedIn URL of the company. (e.g., 'https://www.linkedin.com/company/microsoft')",
55
+ },
56
+ retrieveEmployees: {
57
+ type: 'boolean',
58
+ description:
59
+ "Optional. Whether to retrieve the company's employees information. Default is false.",
60
+ },
61
+ retrievePosts: {
62
+ type: 'boolean',
63
+ description:
64
+ "Optional. Whether to retrieve the company's posts information. Default is false.",
65
+ },
66
+ retrieveDMs: {
67
+ type: 'boolean',
68
+ description:
69
+ "Optional. Whether to retrieve the company's decision makers information. Default is false.",
70
+ },
71
+ postsRetrievalConfig: {
72
+ type: 'object',
73
+ description:
74
+ 'Optional. Configuration for retrieving posts. Available only if retrievePosts is true.',
75
+ properties: {
76
+ limit: {
77
+ type: 'number',
78
+ description:
79
+ 'Optional. Number of posts to retrieve. Defaults to 20, with a maximum value of 20.',
80
+ },
81
+ since: {
82
+ type: 'string',
83
+ description:
84
+ 'Optional. ISO 8601 timestamp to filter posts published after the specified time.',
85
+ },
86
+ },
87
+ },
88
+ dmsRetrievalConfig: {
89
+ type: 'object',
90
+ description:
91
+ 'Optional. Configuration for retrieving decision makers. Available only if retrieveDMs is true.',
92
+ properties: {
93
+ limit: {
94
+ type: 'number',
95
+ description:
96
+ 'Optional. Number of decision makers to retrieve. Defaults to 20, with a maximum value of 20. If a company has fewer decision makers than specified, only the available ones will be returned.',
97
+ },
98
+ },
99
+ },
100
+ employeesRetrievalConfig: {
101
+ type: 'object',
102
+ description:
103
+ 'Optional. Configuration for retrieving employees. Available only if retrieveEmployees is true.',
104
+ properties: {
105
+ limit: {
106
+ type: 'number',
107
+ description:
108
+ 'Optional. Maximum number of employees to retrieve. Defaults to 500, with a maximum value of 500.',
109
+ },
110
+ filter: {
111
+ type: 'object',
112
+ description:
113
+ 'Optional. Object that specifies filtering criteria for employees. When multiple filter fields are specified, they are combined using AND logic.',
114
+ properties: {
115
+ firstName: {
116
+ type: 'string',
117
+ description: 'Optional. First name of employee.',
118
+ },
119
+ lastName: {
120
+ type: 'string',
121
+ description: 'Optional. Last name of employee.',
122
+ },
123
+ position: {
124
+ type: 'string',
125
+ description: 'Optional. Job position of employee.',
126
+ },
127
+ locations: {
128
+ type: 'array',
129
+ description:
130
+ 'Optional. Array of free-form strings representing locations. Matches if employee is located in any of the listed locations.',
131
+ items: { type: 'string' },
132
+ },
133
+ industries: {
134
+ type: 'array',
135
+ description:
136
+ 'Optional. Array of enums representing industries. Matches if employee works in any of the listed industries. Takes specific values available in the LinkedIn interface.',
137
+ items: { type: 'string' },
138
+ },
139
+ schools: {
140
+ type: 'array',
141
+ description:
142
+ 'Optional. Array of institution names. Matches if employee currently attends or previously attended any of the listed institutions.',
143
+ items: { type: 'string' },
144
+ },
145
+ },
146
+ },
147
+ },
148
+ },
149
+ },
150
+ required: ['companyUrl'],
151
+ },
152
+ };
153
+ }
154
+ }
@@ -0,0 +1,145 @@
1
+ import { OPERATION_NAME, TFetchPersonParams } 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 FetchPersonTool extends OperationTool<TFetchPersonParams, unknown> {
8
+ public override readonly name = 'fetch_person';
9
+ public override readonly operationName = OPERATION_NAME.fetchPerson;
10
+ protected override readonly schema = z.object({
11
+ personUrl: z.string(),
12
+ retrieveExperience: z.boolean().optional().default(false),
13
+ retrieveEducation: z.boolean().optional().default(false),
14
+ retrieveSkills: z.boolean().optional().default(false),
15
+ retrieveLanguages: z.boolean().optional().default(false),
16
+ retrievePosts: z.boolean().optional().default(false),
17
+ retrieveComments: z.boolean().optional().default(false),
18
+ retrieveReactions: z.boolean().optional().default(false),
19
+ postsRetrievalConfig: z
20
+ .object({
21
+ limit: z.number().min(1).max(20).optional(),
22
+ since: z.string().optional(),
23
+ })
24
+ .optional(),
25
+ commentsRetrievalConfig: z
26
+ .object({
27
+ limit: z.number().min(1).max(20).optional(),
28
+ since: z.string().optional(),
29
+ })
30
+ .optional(),
31
+ reactionsRetrievalConfig: z
32
+ .object({
33
+ limit: z.number().min(1).max(20).optional(),
34
+ since: z.string().optional(),
35
+ })
36
+ .optional(),
37
+ });
38
+
39
+ public override getTool(): Tool {
40
+ return {
41
+ name: this.name,
42
+ description: `Allows you to open a person page to retrieve their basic information and perform additional person-related actions if needed. (st.openPersonPage action). Allows additional optional retrieval of experience, education, skills, languages, posts, comments and reactions.
43
+ ⚠️ **PERFORMANCE WARNING**: Only set additional retrieval flags to true if you specifically need that data. Each additional parameter significantly increases execution time:
44
+ 💡 **Recommendation**: Start with basic info only. Only request additional data if the user explicitly asks for it or if it's essential for the current task.
45
+ `,
46
+ inputSchema: {
47
+ type: 'object',
48
+ properties: {
49
+ personUrl: {
50
+ type: 'string',
51
+ description:
52
+ "The LinkedIn profile URL of the person to fetch (e.g., 'https://www.linkedin.com/in/john-doe')",
53
+ },
54
+ retrieveExperience: {
55
+ type: 'boolean',
56
+ description:
57
+ "Optional. Whether to retrieve the person's experience information. Default is false.",
58
+ },
59
+ retrieveEducation: {
60
+ type: 'boolean',
61
+ description:
62
+ "Optional. Whether to retrieve the person's education information. Default is false.",
63
+ },
64
+ retrieveSkills: {
65
+ type: 'boolean',
66
+ description:
67
+ "Optional. Whether to retrieve the person's skills information. Default is false.",
68
+ },
69
+ retrieveLanguages: {
70
+ type: 'boolean',
71
+ description:
72
+ "Optional. Whether to retrieve the person's languages information. Default is false.",
73
+ },
74
+ retrievePosts: {
75
+ type: 'boolean',
76
+ description:
77
+ "Optional. Whether to retrieve the person's posts information. Default is false.",
78
+ },
79
+ retrieveComments: {
80
+ type: 'boolean',
81
+ description:
82
+ "Optional. Whether to retrieve the person's comments information. Default is false.",
83
+ },
84
+ retrieveReactions: {
85
+ type: 'boolean',
86
+ description:
87
+ "Optional. Whether to retrieve the person's reactions information. Default is false.",
88
+ },
89
+ postsRetrievalConfig: {
90
+ type: 'object',
91
+ description:
92
+ 'Optional. Configuration for retrieving posts. Available only if retrievePosts is true.',
93
+ properties: {
94
+ limit: {
95
+ type: 'number',
96
+ description:
97
+ 'Optional. Number of posts to retrieve. Defaults to 20, with a maximum value of 20.',
98
+ },
99
+ since: {
100
+ type: 'string',
101
+ description:
102
+ 'Optional. ISO 8601 timestamp to filter posts published after the specified time.',
103
+ },
104
+ },
105
+ },
106
+ commentsRetrievalConfig: {
107
+ type: 'object',
108
+ description:
109
+ 'Optional. Configuration for retrieving comments. Available only if retrieveComments is true.',
110
+ properties: {
111
+ limit: {
112
+ type: 'number',
113
+ description:
114
+ 'Optional. Number of comments to retrieve. Defaults to 20, with a maximum value of 20.',
115
+ },
116
+ since: {
117
+ type: 'string',
118
+ description:
119
+ 'Optional. ISO 8601 timestamp to filter comments made after the specified time.',
120
+ },
121
+ },
122
+ },
123
+ reactionsRetrievalConfig: {
124
+ type: 'object',
125
+ description:
126
+ 'Optional. Configuration for retrieving reactions. Available only if retrieveReactions is true.',
127
+ properties: {
128
+ limit: {
129
+ type: 'number',
130
+ description:
131
+ 'Optional. Number of reactions to retrieve. Defaults to 20, with a maximum value of 20.',
132
+ },
133
+ since: {
134
+ type: 'string',
135
+ description:
136
+ 'Optional. ISO 8601 timestamp to filter reactions made after the specified time.',
137
+ },
138
+ },
139
+ },
140
+ },
141
+ required: ['personUrl'],
142
+ },
143
+ };
144
+ }
145
+ }
@@ -0,0 +1,90 @@
1
+ import { OPERATION_NAME, TFetchPostParams } 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 FetchPostTool extends OperationTool<TFetchPostParams, unknown> {
8
+ public override readonly name = 'fetch_post';
9
+ public override readonly operationName = OPERATION_NAME.fetchPost;
10
+ protected override readonly schema = z.object({
11
+ postUrl: z.string(),
12
+ retrieveComments: z.boolean().optional(),
13
+ retrieveReactions: z.boolean().optional(),
14
+ commentsRetrievalConfig: z
15
+ .object({
16
+ limit: z.number().min(1).max(500).optional(),
17
+ replies: z.boolean().optional(),
18
+ sort: z.enum(['mostRelevant', 'mostRecent']).optional(),
19
+ })
20
+ .optional(),
21
+ reactionsRetrievalConfig: z
22
+ .object({
23
+ limit: z.number().min(1).max(1000).optional(),
24
+ })
25
+ .optional(),
26
+ });
27
+
28
+ public override getTool(): Tool {
29
+ return {
30
+ name: this.name,
31
+ description:
32
+ 'Open a LinkedIn post and retrieve its data, with optional comments and reactions. (st.openPost action).',
33
+ inputSchema: {
34
+ type: 'object',
35
+ properties: {
36
+ postUrl: {
37
+ type: 'string',
38
+ description:
39
+ "LinkedIn URL of the post. (e.g., 'https://www.linkedin.com/posts/username_activity-id')",
40
+ },
41
+ retrieveComments: {
42
+ type: 'boolean',
43
+ description:
44
+ 'Optional. When true, also retrieve comments for the post. Configure via commentsRetrievalConfig.',
45
+ },
46
+ retrieveReactions: {
47
+ type: 'boolean',
48
+ description:
49
+ 'Optional. When true, also retrieve reactions for the post. Configure via reactionsRetrievalConfig.',
50
+ },
51
+ commentsRetrievalConfig: {
52
+ type: 'object',
53
+ description:
54
+ 'Optional. Applies only when retrieveComments is true. Controls comments retrieval (limit, replies, sort).',
55
+ properties: {
56
+ limit: {
57
+ type: 'number',
58
+ description:
59
+ 'Optional. Max number of comments to retrieve. Defaults to 10, with a maximum value of 500.',
60
+ },
61
+ replies: {
62
+ type: 'boolean',
63
+ description: 'Optional. When true, include replies to comments (threaded).',
64
+ },
65
+ sort: {
66
+ type: 'string',
67
+ enum: ['mostRelevant', 'mostRecent'],
68
+ description:
69
+ "Optional. Sort order for comments. One of 'mostRelevant' or 'mostRecent'.",
70
+ },
71
+ },
72
+ },
73
+ reactionsRetrievalConfig: {
74
+ type: 'object',
75
+ description:
76
+ 'Optional. Applies only when retrieveReactions is true. Controls reactions retrieval (limit).',
77
+ properties: {
78
+ limit: {
79
+ type: 'number',
80
+ description:
81
+ 'Optional. Max number of reactions to retrieve. Defaults to 10, with a maximum value of 1000.',
82
+ },
83
+ },
84
+ },
85
+ },
86
+ required: ['postUrl'],
87
+ },
88
+ };
89
+ }
90
+ }
@@ -0,0 +1,48 @@
1
+ import LinkedApi, { TApiUsageAction, TApiUsageParams, TMappedResponse } from '@linkedapi/node';
2
+ import { Tool } from '@modelcontextprotocol/sdk/types.js';
3
+ import z from 'zod';
4
+
5
+ import { LinkedApiTool } from '../utils/linked-api-tool.js';
6
+
7
+ export class GetApiUsageTool extends LinkedApiTool<TApiUsageParams, TApiUsageAction[]> {
8
+ public readonly name = 'get_api_usage';
9
+ protected readonly schema = z.object({
10
+ start: z.string(),
11
+ end: z.string(),
12
+ });
13
+
14
+ public override async execute({
15
+ linkedapi,
16
+ args,
17
+ }: {
18
+ linkedapi: LinkedApi;
19
+ args: TApiUsageParams;
20
+ workflowTimeout: number;
21
+ progressToken?: string | number;
22
+ }): Promise<TMappedResponse<TApiUsageAction[]>> {
23
+ return await linkedapi.getApiUsage(args);
24
+ }
25
+
26
+ public override getTool(): Tool {
27
+ return {
28
+ name: this.name,
29
+ description: 'Retrieve Linked API usage statistics. Date range must not exceed 30 days.',
30
+ inputSchema: {
31
+ type: 'object',
32
+ properties: {
33
+ start: {
34
+ type: 'string',
35
+ description:
36
+ "Start date for the statistics period in ISO 8601 format (e.g., '2024-01-01T00:00:00Z')",
37
+ },
38
+ end: {
39
+ type: 'string',
40
+ description:
41
+ "End date for the statistics period in ISO 8601 format (e.g., '2024-01-30T00:00:00Z')",
42
+ },
43
+ },
44
+ required: ['start', 'end'],
45
+ },
46
+ };
47
+ }
48
+ }