@linkedapi/mcp 2.3.10 → 2.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.
@@ -5,9 +5,31 @@ import { OperationTool } from '../utils/linked-api-tool.js';
5
5
  export declare class ExecuteCustomWorkflowTool extends OperationTool<TWorkflowDefinition, TWorkflowCompletion> {
6
6
  readonly name = "execute_custom_workflow";
7
7
  readonly operationName: "customWorkflow";
8
- protected readonly schema: z.ZodObject<{
9
- definition: z.ZodAny;
10
- }, z.core.$strip>;
8
+ protected readonly schema: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
9
+ actionType: z.ZodString;
10
+ }, z.core.$loose>, z.ZodArray<z.ZodObject<{
11
+ actionType: z.ZodString;
12
+ }, z.core.$loose>>]>, z.ZodPipe<z.ZodObject<{
13
+ definition: z.ZodUnion<readonly [z.ZodObject<{
14
+ actionType: z.ZodString;
15
+ }, z.core.$loose>, z.ZodArray<z.ZodObject<{
16
+ actionType: z.ZodString;
17
+ }, z.core.$loose>>]>;
18
+ }, z.core.$strip>, z.ZodTransform<{
19
+ [x: string]: unknown;
20
+ actionType: string;
21
+ } | {
22
+ [x: string]: unknown;
23
+ actionType: string;
24
+ }[], {
25
+ definition: {
26
+ [x: string]: unknown;
27
+ actionType: string;
28
+ } | {
29
+ [x: string]: unknown;
30
+ actionType: string;
31
+ }[];
32
+ }>>]>;
11
33
  getTool(): Tool;
12
34
  }
13
35
  //# sourceMappingURL=execute-custom-workflow.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"execute-custom-workflow.d.ts","sourceRoot":"","sources":["../../src/tools/execute-custom-workflow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC3F,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC1D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D,qBAAa,yBAA0B,SAAQ,aAAa,CAC1D,mBAAmB,EACnB,mBAAmB,CACpB;IACC,SAAyB,IAAI,6BAA6B;IAC1D,SAAyB,aAAa,mBAAiC;IACvE,mBAA4B,MAAM;;sBAE/B;IAEa,OAAO,IAAI,IAAI;CAYhC"}
1
+ {"version":3,"file":"execute-custom-workflow.d.ts","sourceRoot":"","sources":["../../src/tools/execute-custom-workflow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC3F,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC1D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAkB5D,qBAAa,yBAA0B,SAAQ,aAAa,CAC1D,mBAAmB,EACnB,mBAAmB,CACpB;IACC,SAAyB,IAAI,6BAA6B;IAC1D,SAAyB,aAAa,mBAAiC;IACvE,mBAA4B,MAAM;;;;;;;;;;;;;;;;;;;;;;;;UAAkC;IAEpD,OAAO,IAAI,IAAI;CAkDhC"}
@@ -4,20 +4,71 @@ exports.ExecuteCustomWorkflowTool = void 0;
4
4
  const node_1 = require("@linkedapi/node");
5
5
  const zod_1 = require("zod");
6
6
  const linked_api_tool_js_1 = require("../utils/linked-api-tool.js");
7
+ const SINGLE_ACTION_WORKFLOW_SCHEMA = zod_1.z.looseObject({
8
+ actionType: zod_1.z.string().min(1),
9
+ });
10
+ const WORKFLOW_DEFINITION_SCHEMA = zod_1.z.union([
11
+ SINGLE_ACTION_WORKFLOW_SCHEMA,
12
+ zod_1.z.array(SINGLE_ACTION_WORKFLOW_SCHEMA).min(1),
13
+ ]);
14
+ const EXECUTE_CUSTOM_WORKFLOW_SCHEMA = zod_1.z.union([
15
+ WORKFLOW_DEFINITION_SCHEMA,
16
+ zod_1.z
17
+ .object({
18
+ definition: WORKFLOW_DEFINITION_SCHEMA,
19
+ })
20
+ .transform(({ definition }) => definition),
21
+ ]);
7
22
  class ExecuteCustomWorkflowTool extends linked_api_tool_js_1.OperationTool {
8
23
  name = 'execute_custom_workflow';
9
24
  operationName = node_1.OPERATION_NAME.customWorkflow;
10
- schema = zod_1.z.object({
11
- definition: zod_1.z.any(),
12
- });
25
+ schema = EXECUTE_CUSTOM_WORKFLOW_SCHEMA;
13
26
  getTool() {
14
27
  return {
15
28
  name: this.name,
16
- description: 'Execute a custom workflow definition. If this workflow is still running, do not retry this tool; retrying can duplicate any write actions inside the custom workflow.',
29
+ description: 'Execute a custom workflow definition. Pass a single action with actionType and its parameters at the top level. A single-action or array definition can alternatively be passed in definition. If this workflow is still running, do not retry this tool; retrying can duplicate any write actions inside the custom workflow.',
17
30
  inputSchema: {
18
31
  type: 'object',
19
- properties: { definition: { type: 'object' } },
20
- required: ['definition'],
32
+ properties: {
33
+ actionType: {
34
+ type: 'string',
35
+ minLength: 1,
36
+ description: 'The action type for a single-action workflow.',
37
+ },
38
+ definition: {
39
+ description: 'A single-action or array workflow definition.',
40
+ oneOf: [
41
+ {
42
+ type: 'object',
43
+ properties: {
44
+ actionType: {
45
+ type: 'string',
46
+ minLength: 1,
47
+ },
48
+ },
49
+ required: ['actionType'],
50
+ additionalProperties: true,
51
+ },
52
+ {
53
+ type: 'array',
54
+ minItems: 1,
55
+ items: {
56
+ type: 'object',
57
+ properties: {
58
+ actionType: {
59
+ type: 'string',
60
+ minLength: 1,
61
+ },
62
+ },
63
+ required: ['actionType'],
64
+ additionalProperties: true,
65
+ },
66
+ },
67
+ ],
68
+ },
69
+ },
70
+ anyOf: [{ required: ['actionType'] }, { required: ['definition'] }],
71
+ additionalProperties: true,
21
72
  },
22
73
  };
23
74
  }
@@ -1 +1 @@
1
- {"version":3,"file":"execute-custom-workflow.js","sourceRoot":"","sources":["../../src/tools/execute-custom-workflow.ts"],"names":[],"mappings":";;;AAAA,0CAA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4
  "description": "MCP server that lets AI assistants control LinkedIn accounts and retrieve real-time data.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -4,25 +4,77 @@ import { z } from 'zod';
4
4
 
5
5
  import { OperationTool } from '../utils/linked-api-tool.js';
6
6
 
7
+ const SINGLE_ACTION_WORKFLOW_SCHEMA = z.looseObject({
8
+ actionType: z.string().min(1),
9
+ });
10
+ const WORKFLOW_DEFINITION_SCHEMA = z.union([
11
+ SINGLE_ACTION_WORKFLOW_SCHEMA,
12
+ z.array(SINGLE_ACTION_WORKFLOW_SCHEMA).min(1),
13
+ ]);
14
+ const EXECUTE_CUSTOM_WORKFLOW_SCHEMA = z.union([
15
+ WORKFLOW_DEFINITION_SCHEMA,
16
+ z
17
+ .object({
18
+ definition: WORKFLOW_DEFINITION_SCHEMA,
19
+ })
20
+ .transform(({ definition }) => definition),
21
+ ]);
22
+
7
23
  export class ExecuteCustomWorkflowTool extends OperationTool<
8
24
  TWorkflowDefinition,
9
25
  TWorkflowCompletion
10
26
  > {
11
27
  public override readonly name = 'execute_custom_workflow';
12
28
  public override readonly operationName = OPERATION_NAME.customWorkflow;
13
- protected override readonly schema = z.object({
14
- definition: z.any(),
15
- });
29
+ protected override readonly schema = EXECUTE_CUSTOM_WORKFLOW_SCHEMA;
16
30
 
17
31
  public override getTool(): Tool {
18
32
  return {
19
33
  name: this.name,
20
34
  description:
21
- 'Execute a custom workflow definition. If this workflow is still running, do not retry this tool; retrying can duplicate any write actions inside the custom workflow.',
35
+ 'Execute a custom workflow definition. Pass a single action with actionType and its parameters at the top level. A single-action or array definition can alternatively be passed in definition. If this workflow is still running, do not retry this tool; retrying can duplicate any write actions inside the custom workflow.',
22
36
  inputSchema: {
23
37
  type: 'object',
24
- properties: { definition: { type: 'object' } },
25
- required: ['definition'],
38
+ properties: {
39
+ actionType: {
40
+ type: 'string',
41
+ minLength: 1,
42
+ description: 'The action type for a single-action workflow.',
43
+ },
44
+ definition: {
45
+ description: 'A single-action or array workflow definition.',
46
+ oneOf: [
47
+ {
48
+ type: 'object',
49
+ properties: {
50
+ actionType: {
51
+ type: 'string',
52
+ minLength: 1,
53
+ },
54
+ },
55
+ required: ['actionType'],
56
+ additionalProperties: true,
57
+ },
58
+ {
59
+ type: 'array',
60
+ minItems: 1,
61
+ items: {
62
+ type: 'object',
63
+ properties: {
64
+ actionType: {
65
+ type: 'string',
66
+ minLength: 1,
67
+ },
68
+ },
69
+ required: ['actionType'],
70
+ additionalProperties: true,
71
+ },
72
+ },
73
+ ],
74
+ },
75
+ },
76
+ anyOf: [{ required: ['actionType'] }, { required: ['definition'] }],
77
+ additionalProperties: true,
26
78
  },
27
79
  };
28
80
  }