langflow-mcp-server 3.1.1 → 4.12.2
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.
- package/.env.example +19 -1
- package/README.md +350 -82
- package/dist/__tests__/fixtures/advanced-execution.d.ts.map +1 -1
- package/dist/__tests__/fixtures/advanced-execution.js +7 -4
- package/dist/__tests__/fixtures/advanced-execution.js.map +1 -1
- package/dist/__tests__/fixtures/api-keys.js.map +1 -1
- package/dist/__tests__/fixtures/auth.d.ts.map +1 -1
- package/dist/__tests__/fixtures/components.d.ts.map +1 -1
- package/dist/__tests__/fixtures/custom-components.js.map +1 -1
- package/dist/__tests__/fixtures/files.d.ts.map +1 -1
- package/dist/__tests__/fixtures/files.js.map +1 -1
- package/dist/__tests__/fixtures/flows.js.map +1 -1
- package/dist/__tests__/fixtures/folders.js.map +1 -1
- package/dist/__tests__/fixtures/knowledge-bases.d.ts.map +1 -1
- package/dist/__tests__/fixtures/knowledge-bases.js.map +1 -1
- package/dist/__tests__/fixtures/misc.js.map +1 -1
- package/dist/__tests__/fixtures/monitoring.js.map +1 -1
- package/dist/__tests__/fixtures/projects.js.map +1 -1
- package/dist/__tests__/fixtures/run.d.ts.map +1 -1
- package/dist/__tests__/fixtures/store.d.ts.map +1 -1
- package/dist/__tests__/fixtures/store.js.map +1 -1
- package/dist/__tests__/fixtures/users.js.map +1 -1
- package/dist/__tests__/fixtures/variables.js.map +1 -1
- package/dist/__tests__/fixtures/vertices.d.ts +1 -2
- package/dist/__tests__/fixtures/vertices.d.ts.map +1 -1
- package/dist/__tests__/fixtures/vertices.js +1 -5
- package/dist/__tests__/fixtures/vertices.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp/http.d.ts +69 -0
- package/dist/mcp/http.d.ts.map +1 -0
- package/dist/mcp/http.js +595 -0
- package/dist/mcp/http.js.map +1 -0
- package/dist/mcp/index.js +39 -5
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/prompts.js.map +1 -1
- package/dist/mcp/resources.d.ts.map +1 -1
- package/dist/mcp/resources.js +6 -17
- package/dist/mcp/resources.js.map +1 -1
- package/dist/mcp/server-consolidated.d.ts +16 -0
- package/dist/mcp/server-consolidated.d.ts.map +1 -1
- package/dist/mcp/server-consolidated.js +771 -18
- package/dist/mcp/server-consolidated.js.map +1 -1
- package/dist/mcp/server.d.ts +2 -0
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +827 -20
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tools-consolidated.d.ts.map +1 -1
- package/dist/mcp/tools-consolidated.js +813 -47
- package/dist/mcp/tools-consolidated.js.map +1 -1
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +1998 -83
- package/dist/mcp/tools.js.map +1 -1
- package/dist/mcp/validation-consolidated.d.ts +876 -18
- package/dist/mcp/validation-consolidated.d.ts.map +1 -1
- package/dist/mcp/validation-consolidated.js +758 -21
- package/dist/mcp/validation-consolidated.js.map +1 -1
- package/dist/mcp/validation.d.ts +966 -19
- package/dist/mcp/validation.d.ts.map +1 -1
- package/dist/mcp/validation.js +722 -18
- package/dist/mcp/validation.js.map +1 -1
- package/dist/services/langflow-client.d.ts +154 -52
- package/dist/services/langflow-client.d.ts.map +1 -1
- package/dist/services/langflow-client.js +1305 -155
- package/dist/services/langflow-client.js.map +1 -1
- package/dist/types/index.d.ts +536 -10
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +2 -3
- package/dist/utils/logger.js.map +1 -1
- package/package.json +17 -15
package/dist/mcp/server.js
CHANGED
|
@@ -89,7 +89,8 @@ class LangflowMCPServer {
|
|
|
89
89
|
'access_token', 'refresh_token', 'authorization',
|
|
90
90
|
'x-api-key', 'x-store-api-key', 'set-cookie',
|
|
91
91
|
'bearer', 'session', 'session_id', 'cookie',
|
|
92
|
-
'private_key', 'secret', 'credentials', 'api-key'
|
|
92
|
+
'private_key', 'secret', 'credentials', 'api-key',
|
|
93
|
+
'file_content', 'file', 'content', 'payload', 'data', 'auth_settings', 'input_value', 'instruction'
|
|
93
94
|
]);
|
|
94
95
|
if (depth > MAX_DEPTH) {
|
|
95
96
|
return { __error: 'max depth exceeded' };
|
|
@@ -165,6 +166,10 @@ class LangflowMCPServer {
|
|
|
165
166
|
if (!base64Regex.test(fileContent)) {
|
|
166
167
|
throw new Error('Invalid base64 format');
|
|
167
168
|
}
|
|
169
|
+
if (fileContent.length % 4 !== 0 ||
|
|
170
|
+
Buffer.from(fileContent, 'base64').toString('base64') !== fileContent) {
|
|
171
|
+
throw new Error('Invalid base64 format');
|
|
172
|
+
}
|
|
168
173
|
const estimatedSize = (fileContent.length * 3) / 4;
|
|
169
174
|
if (estimatedSize > maxSizeBytes) {
|
|
170
175
|
throw new Error(`File size ${Math.round(estimatedSize)} bytes (estimated) exceeds maximum allowed size of ${maxSizeBytes} bytes (10MB)`);
|
|
@@ -280,7 +285,8 @@ class LangflowMCPServer {
|
|
|
280
285
|
}
|
|
281
286
|
case 'run_flow': {
|
|
282
287
|
const validated = validation_1.RunFlowSchema.parse(args);
|
|
283
|
-
const
|
|
288
|
+
const { context: nestedContext, ...inputRequest } = validated.input_request;
|
|
289
|
+
const result = await this.client.runFlow(validated.flow_id_or_name, inputRequest, validated.stream, validated.context ?? nestedContext);
|
|
284
290
|
return this.formatSuccessResponse(result);
|
|
285
291
|
}
|
|
286
292
|
case 'trigger_webhook': {
|
|
@@ -353,6 +359,12 @@ class LangflowMCPServer {
|
|
|
353
359
|
const updated = await this.client.updateProject(project_id, updates);
|
|
354
360
|
return this.formatSuccessResponse(updated);
|
|
355
361
|
}
|
|
362
|
+
case 'upsert_project': {
|
|
363
|
+
const validated = validation_1.UpsertProjectSchema.parse(args);
|
|
364
|
+
const { project_id, ...body } = validated;
|
|
365
|
+
const project = await this.client.upsertProject(project_id, body);
|
|
366
|
+
return this.formatSuccessResponse(project);
|
|
367
|
+
}
|
|
356
368
|
case 'delete_project': {
|
|
357
369
|
const validated = validation_1.DeleteProjectSchema.parse(args);
|
|
358
370
|
await this.client.deleteProject(validated.project_id);
|
|
@@ -401,16 +413,32 @@ class LangflowMCPServer {
|
|
|
401
413
|
const result = await this.client.buildFlow(flow_id, { inputs, data, files }, params);
|
|
402
414
|
return this.formatSuccessResponse(result);
|
|
403
415
|
}
|
|
416
|
+
case 'build_public_flow': {
|
|
417
|
+
const validated = validation_1.BuildPublicFlowSchema.parse(args);
|
|
418
|
+
const { flow_id, inputs, files, ...params } = validated;
|
|
419
|
+
const result = await this.client.buildPublicFlow(flow_id, { inputs, files }, params);
|
|
420
|
+
return this.formatSuccessResponse(result);
|
|
421
|
+
}
|
|
404
422
|
case 'get_build_status': {
|
|
405
423
|
const validated = validation_1.GetBuildStatusSchema.parse(args);
|
|
406
424
|
const result = await this.client.getBuildStatus(validated.job_id, validated.event_delivery);
|
|
407
425
|
return this.formatSuccessResponse(result);
|
|
408
426
|
}
|
|
427
|
+
case 'get_public_build_events': {
|
|
428
|
+
const validated = validation_1.GetPublicBuildEventsSchema.parse(args);
|
|
429
|
+
const result = await this.client.getPublicBuildEvents(validated.job_id, validated.event_delivery);
|
|
430
|
+
return this.formatSuccessResponse(result);
|
|
431
|
+
}
|
|
409
432
|
case 'cancel_build': {
|
|
410
433
|
const validated = validation_1.CancelBuildSchema.parse(args);
|
|
411
434
|
const result = await this.client.cancelBuild(validated.job_id);
|
|
412
435
|
return this.formatSuccessResponse(result);
|
|
413
436
|
}
|
|
437
|
+
case 'cancel_public_build': {
|
|
438
|
+
const validated = validation_1.CancelPublicBuildSchema.parse(args);
|
|
439
|
+
const result = await this.client.cancelPublicBuild(validated.job_id);
|
|
440
|
+
return this.formatSuccessResponse(result);
|
|
441
|
+
}
|
|
414
442
|
case 'list_knowledge_bases': {
|
|
415
443
|
validation_1.ListKnowledgeBasesSchema.parse(args);
|
|
416
444
|
const knowledgeBases = await this.client.listKnowledgeBases();
|
|
@@ -450,7 +478,7 @@ class LangflowMCPServer {
|
|
|
450
478
|
flow_id: validated.flow_id,
|
|
451
479
|
file_name: validated.file_name
|
|
452
480
|
});
|
|
453
|
-
if (!fileData) {
|
|
481
|
+
if (!fileData || (fileData.byteLength ?? fileData.length) === 0) {
|
|
454
482
|
throw new Error('No file data received from server');
|
|
455
483
|
}
|
|
456
484
|
const base64Data = Buffer.from(fileData).toString('base64');
|
|
@@ -478,7 +506,7 @@ class LangflowMCPServer {
|
|
|
478
506
|
flow_id: validated.flow_id,
|
|
479
507
|
file_name: validated.file_name
|
|
480
508
|
});
|
|
481
|
-
if (!imageData) {
|
|
509
|
+
if (!imageData || (imageData.byteLength ?? imageData.length) === 0) {
|
|
482
510
|
throw new Error('No image data received from server');
|
|
483
511
|
}
|
|
484
512
|
const base64Data = Buffer.from(imageData).toString('base64');
|
|
@@ -495,7 +523,7 @@ class LangflowMCPServer {
|
|
|
495
523
|
case 'get_profile_picture': {
|
|
496
524
|
const validated = validation_1.GetProfilePictureSchema.parse(args);
|
|
497
525
|
const pictureData = await this.client.getProfilePicture(validated.folder_name, validated.file_name);
|
|
498
|
-
if (!pictureData) {
|
|
526
|
+
if (!pictureData || (pictureData.byteLength ?? pictureData.length) === 0) {
|
|
499
527
|
throw new Error('No picture data received from server');
|
|
500
528
|
}
|
|
501
529
|
const base64Data = Buffer.from(pictureData).toString('base64');
|
|
@@ -635,11 +663,6 @@ class LangflowMCPServer {
|
|
|
635
663
|
const result = await this.client.buildVertices(flow_id, request);
|
|
636
664
|
return this.formatSuccessResponse(result);
|
|
637
665
|
}
|
|
638
|
-
case 'get_vertex': {
|
|
639
|
-
const validated = validation_1.GetVertexSchema.parse(args);
|
|
640
|
-
const result = await this.client.getVertex(validated);
|
|
641
|
-
return this.formatSuccessResponse(result);
|
|
642
|
-
}
|
|
643
666
|
case 'stream_vertex_build': {
|
|
644
667
|
const validated = validation_1.StreamVertexBuildSchema.parse(args);
|
|
645
668
|
const result = await this.client.streamVertexBuild(validated);
|
|
@@ -660,11 +683,6 @@ class LangflowMCPServer {
|
|
|
660
683
|
const result = await this.client.getCurrentUser();
|
|
661
684
|
return this.formatSuccessResponse(result);
|
|
662
685
|
}
|
|
663
|
-
case 'get_user': {
|
|
664
|
-
const validated = validation_1.GetUserSchema.parse(args);
|
|
665
|
-
const result = await this.client.getUser(validated.user_id);
|
|
666
|
-
return this.formatSuccessResponse(result);
|
|
667
|
-
}
|
|
668
686
|
case 'update_user': {
|
|
669
687
|
const validated = validation_1.UpdateUserSchema.parse(args);
|
|
670
688
|
const { user_id, ...updates } = validated;
|
|
@@ -694,11 +712,6 @@ class LangflowMCPServer {
|
|
|
694
712
|
await this.client.deleteApiKey(validated.api_key_id);
|
|
695
713
|
return this.formatSuccessResponse({ success: true, message: 'API key deleted successfully' });
|
|
696
714
|
}
|
|
697
|
-
case 'list_custom_components': {
|
|
698
|
-
validation_1.ListCustomComponentsSchema.parse(args);
|
|
699
|
-
const result = await this.client.listCustomComponents();
|
|
700
|
-
return this.formatSuccessResponse(result);
|
|
701
|
-
}
|
|
702
715
|
case 'create_custom_component': {
|
|
703
716
|
const validated = validation_1.CreateCustomComponentSchema.parse(args);
|
|
704
717
|
const result = await this.client.createCustomComponent(validated);
|
|
@@ -779,6 +792,797 @@ class LangflowMCPServer {
|
|
|
779
792
|
const result = await this.client.getLogs(validated.stream);
|
|
780
793
|
return this.formatSuccessResponse(result);
|
|
781
794
|
}
|
|
795
|
+
case 'replace_flow': {
|
|
796
|
+
const validated = validation_1.ReplaceFlowSchema.parse(args);
|
|
797
|
+
const { flow_id, ...body } = validated;
|
|
798
|
+
const result = await this.client.replaceFlow(flow_id, body);
|
|
799
|
+
return this.formatSuccessResponse(result);
|
|
800
|
+
}
|
|
801
|
+
case 'expand_flows': {
|
|
802
|
+
const validated = validation_1.ExpandFlowsSchema.parse(args);
|
|
803
|
+
const result = await this.client.expandFlows(validated.body);
|
|
804
|
+
return this.formatSuccessResponse(result);
|
|
805
|
+
}
|
|
806
|
+
case 'get_flow_events': {
|
|
807
|
+
const validated = validation_1.GetFlowEventsSchema.parse(args);
|
|
808
|
+
const result = await this.client.getFlowEvents(validated.flow_id, validated.since !== undefined ? { since: validated.since } : undefined);
|
|
809
|
+
return this.formatSuccessResponse(result);
|
|
810
|
+
}
|
|
811
|
+
case 'create_flow_event': {
|
|
812
|
+
const validated = validation_1.CreateFlowEventSchema.parse(args);
|
|
813
|
+
const { flow_id, ...body } = validated;
|
|
814
|
+
const result = await this.client.createFlowEvent(flow_id, body);
|
|
815
|
+
return this.formatSuccessResponse(result);
|
|
816
|
+
}
|
|
817
|
+
case 'list_flow_versions': {
|
|
818
|
+
const validated = validation_1.ListFlowVersionsSchema.parse(args);
|
|
819
|
+
const { flow_id, ...params } = validated;
|
|
820
|
+
const result = await this.client.listFlowVersions(flow_id, params);
|
|
821
|
+
return this.formatSuccessResponse(result);
|
|
822
|
+
}
|
|
823
|
+
case 'create_flow_version': {
|
|
824
|
+
const validated = validation_1.CreateFlowVersionSchema.parse(args);
|
|
825
|
+
const result = await this.client.createFlowVersion(validated.flow_id, validated.body);
|
|
826
|
+
return this.formatSuccessResponse(result);
|
|
827
|
+
}
|
|
828
|
+
case 'get_flow_version': {
|
|
829
|
+
const validated = validation_1.GetFlowVersionSchema.parse(args);
|
|
830
|
+
const result = await this.client.getFlowVersion(validated.flow_id, validated.version_id);
|
|
831
|
+
return this.formatSuccessResponse(result);
|
|
832
|
+
}
|
|
833
|
+
case 'delete_flow_version': {
|
|
834
|
+
const validated = validation_1.DeleteFlowVersionSchema.parse(args);
|
|
835
|
+
await this.client.deleteFlowVersion(validated.flow_id, validated.version_id);
|
|
836
|
+
return this.formatSuccessResponse({
|
|
837
|
+
success: true,
|
|
838
|
+
message: 'Flow version deleted successfully'
|
|
839
|
+
});
|
|
840
|
+
}
|
|
841
|
+
case 'activate_flow_version': {
|
|
842
|
+
const validated = validation_1.ActivateFlowVersionSchema.parse(args);
|
|
843
|
+
const result = await this.client.activateFlowVersion(validated.flow_id, validated.version_id, validated.save_draft !== undefined ? { save_draft: validated.save_draft } : undefined);
|
|
844
|
+
return this.formatSuccessResponse(result);
|
|
845
|
+
}
|
|
846
|
+
case 'detect_variables': {
|
|
847
|
+
const validated = validation_1.DetectVariablesSchema.parse(args);
|
|
848
|
+
const result = await this.client.detectVariables({ flow_version_ids: validated.flow_version_ids });
|
|
849
|
+
return this.formatSuccessResponse(result);
|
|
850
|
+
}
|
|
851
|
+
case 'save_store_api_key': {
|
|
852
|
+
const validated = validation_1.SaveStoreApiKeySchema.parse(args);
|
|
853
|
+
const result = await this.client.saveStoreApiKey(validated.api_key);
|
|
854
|
+
return this.formatSuccessResponse(result);
|
|
855
|
+
}
|
|
856
|
+
case 'update_custom_component': {
|
|
857
|
+
const validated = validation_1.UpdateCustomComponentSchema.parse(args);
|
|
858
|
+
const result = await this.client.updateCustomComponentCode(validated);
|
|
859
|
+
return this.formatSuccessResponse(result);
|
|
860
|
+
}
|
|
861
|
+
case 'create_store_component': {
|
|
862
|
+
const validated = validation_1.CreateStoreComponentSchema.parse(args);
|
|
863
|
+
const result = await this.client.createStoreComponent({
|
|
864
|
+
description: null,
|
|
865
|
+
tags: null,
|
|
866
|
+
is_component: null,
|
|
867
|
+
...validated
|
|
868
|
+
});
|
|
869
|
+
return this.formatSuccessResponse(result);
|
|
870
|
+
}
|
|
871
|
+
case 'like_store_component': {
|
|
872
|
+
const validated = validation_1.LikeStoreComponentSchema.parse(args);
|
|
873
|
+
const result = await this.client.likeStoreComponent(validated.component_id);
|
|
874
|
+
return this.formatSuccessResponse(result);
|
|
875
|
+
}
|
|
876
|
+
case 'create_response': {
|
|
877
|
+
const validated = validation_1.CreateResponseSchema.parse(args);
|
|
878
|
+
const result = await this.client.createResponse(validated);
|
|
879
|
+
return this.formatSuccessResponse(result);
|
|
880
|
+
}
|
|
881
|
+
case 'get_session': {
|
|
882
|
+
validation_1.GetSessionSchema.parse(args);
|
|
883
|
+
const result = await this.client.getSession();
|
|
884
|
+
return this.formatSuccessResponse(result);
|
|
885
|
+
}
|
|
886
|
+
case 'create_user': {
|
|
887
|
+
const validated = validation_1.CreateUserSchema.parse(args);
|
|
888
|
+
const result = await this.client.createUser(validated);
|
|
889
|
+
return this.formatSuccessResponse(result);
|
|
890
|
+
}
|
|
891
|
+
case 'get_webhook_events': {
|
|
892
|
+
const validated = validation_1.GetWebhookEventsSchema.parse(args);
|
|
893
|
+
const result = await this.client.getWebhookEvents(validated.flow_id_or_name, validated.user_id ? { user_id: validated.user_id } : undefined);
|
|
894
|
+
return this.formatSuccessResponse(result);
|
|
895
|
+
}
|
|
896
|
+
case 'get_health_check': {
|
|
897
|
+
validation_1.GetHealthCheckSchema.parse(args);
|
|
898
|
+
const result = await this.client.getHealthCheck();
|
|
899
|
+
return this.formatSuccessResponse(result);
|
|
900
|
+
}
|
|
901
|
+
case 'get_healthz': {
|
|
902
|
+
validation_1.GetHealthzSchema.parse(args);
|
|
903
|
+
const result = await this.client.getHealthz();
|
|
904
|
+
return this.formatSuccessResponse(result);
|
|
905
|
+
}
|
|
906
|
+
case 'list_files_v2': {
|
|
907
|
+
validation_1.ListFilesV2Schema.parse(args);
|
|
908
|
+
const result = await this.client.listFilesV2();
|
|
909
|
+
return this.formatSuccessResponse(result);
|
|
910
|
+
}
|
|
911
|
+
case 'upload_file_v2': {
|
|
912
|
+
const validated = validation_1.UploadFileV2Schema.parse(args);
|
|
913
|
+
const fileBuffer = this.validateFileSize(validated.file_content);
|
|
914
|
+
const params = {};
|
|
915
|
+
if (validated.append !== undefined)
|
|
916
|
+
params.append = validated.append;
|
|
917
|
+
if (validated.ephemeral !== undefined)
|
|
918
|
+
params.ephemeral = validated.ephemeral;
|
|
919
|
+
const result = await this.client.uploadFileV2(fileBuffer, validated.file_name, params);
|
|
920
|
+
return this.formatSuccessResponse(result);
|
|
921
|
+
}
|
|
922
|
+
case 'get_file_v2': {
|
|
923
|
+
const validated = validation_1.GetFileV2Schema.parse(args);
|
|
924
|
+
const result = await this.client.getFileV2(validated.file_id, validated.return_content !== undefined ? { return_content: validated.return_content } : undefined);
|
|
925
|
+
return this.formatSuccessResponse(result);
|
|
926
|
+
}
|
|
927
|
+
case 'rename_file_v2': {
|
|
928
|
+
const validated = validation_1.RenameFileV2Schema.parse(args);
|
|
929
|
+
const result = await this.client.renameFileV2(validated.file_id, validated.name);
|
|
930
|
+
return this.formatSuccessResponse(result);
|
|
931
|
+
}
|
|
932
|
+
case 'delete_file_v2': {
|
|
933
|
+
const validated = validation_1.DeleteFileV2Schema.parse(args);
|
|
934
|
+
const result = await this.client.deleteFileV2(validated.file_id);
|
|
935
|
+
return this.formatSuccessResponse(result);
|
|
936
|
+
}
|
|
937
|
+
case 'delete_all_files_v2': {
|
|
938
|
+
validation_1.DeleteAllFilesV2Schema.parse(args);
|
|
939
|
+
const result = await this.client.deleteAllFilesV2();
|
|
940
|
+
return this.formatSuccessResponse(result);
|
|
941
|
+
}
|
|
942
|
+
case 'batch_download_files_v2': {
|
|
943
|
+
const validated = validation_1.BatchDownloadFilesV2Schema.parse(args);
|
|
944
|
+
const result = await this.client.batchDownloadFilesV2(validated.file_ids);
|
|
945
|
+
return this.formatSuccessResponse(result);
|
|
946
|
+
}
|
|
947
|
+
case 'batch_delete_files_v2': {
|
|
948
|
+
const validated = validation_1.BatchDeleteFilesV2Schema.parse(args);
|
|
949
|
+
const result = await this.client.batchDeleteFilesV2(validated.file_ids);
|
|
950
|
+
return this.formatSuccessResponse(result);
|
|
951
|
+
}
|
|
952
|
+
case 'list_knowledge_bases_detailed': {
|
|
953
|
+
validation_1.ListKnowledgeBasesDetailedSchema.parse(args);
|
|
954
|
+
const result = await this.client.listKnowledgeBasesDetailed();
|
|
955
|
+
return this.formatSuccessResponse(result);
|
|
956
|
+
}
|
|
957
|
+
case 'create_knowledge_base': {
|
|
958
|
+
const validated = validation_1.CreateKnowledgeBaseSchema.parse(args);
|
|
959
|
+
const result = await this.client.createKnowledgeBase(validated);
|
|
960
|
+
return this.formatSuccessResponse(result);
|
|
961
|
+
}
|
|
962
|
+
case 'preview_knowledge_base_chunks': {
|
|
963
|
+
const validated = validation_1.PreviewKnowledgeBaseChunksSchema.parse(args);
|
|
964
|
+
const fileBuffer = this.validateFileSize(validated.file_content);
|
|
965
|
+
const result = await this.client.previewKnowledgeBaseChunks([{ buffer: fileBuffer, filename: validated.file_name }], validated.params);
|
|
966
|
+
return this.formatSuccessResponse(result);
|
|
967
|
+
}
|
|
968
|
+
case 'list_knowledge_base_chunks': {
|
|
969
|
+
const validated = validation_1.ListKnowledgeBaseChunksSchema.parse(args);
|
|
970
|
+
const { kb_name, ...params } = validated;
|
|
971
|
+
const result = await this.client.listKnowledgeBaseChunks(kb_name, params);
|
|
972
|
+
return this.formatSuccessResponse(result);
|
|
973
|
+
}
|
|
974
|
+
case 'ingest_knowledge_base': {
|
|
975
|
+
const validated = validation_1.IngestKnowledgeBaseSchema.parse(args);
|
|
976
|
+
const fileBuffer = this.validateFileSize(validated.file_content);
|
|
977
|
+
const result = await this.client.ingestKnowledgeBase(validated.kb_name, [{ buffer: fileBuffer, filename: validated.file_name }], validated.params);
|
|
978
|
+
return this.formatSuccessResponse(result);
|
|
979
|
+
}
|
|
980
|
+
case 'cancel_knowledge_base_ingest': {
|
|
981
|
+
const validated = validation_1.CancelKnowledgeBaseIngestSchema.parse(args);
|
|
982
|
+
const result = await this.client.cancelKnowledgeBaseIngest(validated.kb_name);
|
|
983
|
+
return this.formatSuccessResponse(result);
|
|
984
|
+
}
|
|
985
|
+
case 'update_monitor_message': {
|
|
986
|
+
const validated = validation_1.UpdateMonitorMessageSchema.parse(args);
|
|
987
|
+
const { message_id, ...body } = validated;
|
|
988
|
+
const result = await this.client.updateMonitorMessage(message_id, body);
|
|
989
|
+
return this.formatSuccessResponse(result);
|
|
990
|
+
}
|
|
991
|
+
case 'delete_monitor_session_messages': {
|
|
992
|
+
const validated = validation_1.DeleteMonitorSessionMessagesSchema.parse(args);
|
|
993
|
+
const result = await this.client.deleteMonitorSessionMessages(validated.session_id);
|
|
994
|
+
return this.formatSuccessResponse(result);
|
|
995
|
+
}
|
|
996
|
+
case 'delete_monitor_sessions': {
|
|
997
|
+
const validated = validation_1.DeleteMonitorSessionsSchema.parse(args);
|
|
998
|
+
const result = await this.client.deleteMonitorSessions(validated.session_ids);
|
|
999
|
+
return this.formatSuccessResponse(result);
|
|
1000
|
+
}
|
|
1001
|
+
case 'get_shared_messages': {
|
|
1002
|
+
const validated = validation_1.GetSharedMessagesSchema.parse(args);
|
|
1003
|
+
const result = await this.client.getSharedMessages(validated);
|
|
1004
|
+
return this.formatSuccessResponse(result);
|
|
1005
|
+
}
|
|
1006
|
+
case 'get_shared_sessions': {
|
|
1007
|
+
const validated = validation_1.GetSharedSessionsSchema.parse(args);
|
|
1008
|
+
const result = await this.client.getSharedSessions(validated.source_flow_id);
|
|
1009
|
+
return this.formatSuccessResponse(result);
|
|
1010
|
+
}
|
|
1011
|
+
case 'update_shared_message': {
|
|
1012
|
+
const validated = validation_1.UpdateSharedMessageSchema.parse(args);
|
|
1013
|
+
const { message_id, source_flow_id, ...body } = validated;
|
|
1014
|
+
const result = await this.client.updateSharedMessage(message_id, source_flow_id, body);
|
|
1015
|
+
return this.formatSuccessResponse(result);
|
|
1016
|
+
}
|
|
1017
|
+
case 'migrate_shared_session': {
|
|
1018
|
+
const validated = validation_1.MigrateSharedSessionSchema.parse(args);
|
|
1019
|
+
const result = await this.client.migrateSharedSession(validated.session_id, {
|
|
1020
|
+
new_session_id: validated.new_session_id,
|
|
1021
|
+
source_flow_id: validated.source_flow_id
|
|
1022
|
+
});
|
|
1023
|
+
return this.formatSuccessResponse(result);
|
|
1024
|
+
}
|
|
1025
|
+
case 'delete_shared_session': {
|
|
1026
|
+
const validated = validation_1.DeleteSharedSessionSchema.parse(args);
|
|
1027
|
+
const result = await this.client.deleteSharedSession(validated.session_id, validated.source_flow_id);
|
|
1028
|
+
return this.formatSuccessResponse(result);
|
|
1029
|
+
}
|
|
1030
|
+
case 'list_traces': {
|
|
1031
|
+
const validated = validation_1.ListTracesSchema.parse(args);
|
|
1032
|
+
const result = await this.client.listTraces(validated);
|
|
1033
|
+
return this.formatSuccessResponse(result);
|
|
1034
|
+
}
|
|
1035
|
+
case 'delete_traces': {
|
|
1036
|
+
const validated = validation_1.DeleteTracesSchema.parse(args);
|
|
1037
|
+
const result = await this.client.deleteTraces(validated.flow_id);
|
|
1038
|
+
return this.formatSuccessResponse(result);
|
|
1039
|
+
}
|
|
1040
|
+
case 'get_trace': {
|
|
1041
|
+
const validated = validation_1.GetTraceSchema.parse(args);
|
|
1042
|
+
const result = await this.client.getTrace(validated.trace_id);
|
|
1043
|
+
return this.formatSuccessResponse(result);
|
|
1044
|
+
}
|
|
1045
|
+
case 'delete_trace': {
|
|
1046
|
+
const validated = validation_1.DeleteTraceSchema.parse(args);
|
|
1047
|
+
await this.client.deleteTrace(validated.trace_id);
|
|
1048
|
+
return this.formatSuccessResponse({
|
|
1049
|
+
success: true,
|
|
1050
|
+
message: 'Trace deleted successfully'
|
|
1051
|
+
});
|
|
1052
|
+
}
|
|
1053
|
+
case 'list_models': {
|
|
1054
|
+
const validated = validation_1.ListModelsSchema.parse(args);
|
|
1055
|
+
const result = await this.client.listModels(validated);
|
|
1056
|
+
return this.formatSuccessResponse(result);
|
|
1057
|
+
}
|
|
1058
|
+
case 'list_model_providers': {
|
|
1059
|
+
const validated = validation_1.ListModelProvidersSchema.parse(args);
|
|
1060
|
+
const result = await this.client.listModelProviders(validated.purpose ? { purpose: validated.purpose } : undefined);
|
|
1061
|
+
return this.formatSuccessResponse(result);
|
|
1062
|
+
}
|
|
1063
|
+
case 'list_model_provider_descriptors': {
|
|
1064
|
+
const validated = validation_1.ListModelProviderDescriptorsSchema.parse(args);
|
|
1065
|
+
const result = await this.client.listModelProviderDescriptors(validated.purpose ? { purpose: validated.purpose } : undefined);
|
|
1066
|
+
return this.formatSuccessResponse(result);
|
|
1067
|
+
}
|
|
1068
|
+
case 'list_enabled_providers': {
|
|
1069
|
+
const validated = validation_1.ListEnabledProvidersSchema.parse(args);
|
|
1070
|
+
const result = await this.client.listEnabledProviders(validated.providers || validated.purpose
|
|
1071
|
+
? { providers: validated.providers, purpose: validated.purpose }
|
|
1072
|
+
: undefined);
|
|
1073
|
+
return this.formatSuccessResponse(result);
|
|
1074
|
+
}
|
|
1075
|
+
case 'list_enabled_models': {
|
|
1076
|
+
const validated = validation_1.ListEnabledModelsSchema.parse(args);
|
|
1077
|
+
const result = await this.client.listEnabledModels(validated.model_names || validated.purpose
|
|
1078
|
+
? { model_names: validated.model_names, purpose: validated.purpose }
|
|
1079
|
+
: undefined);
|
|
1080
|
+
return this.formatSuccessResponse(result);
|
|
1081
|
+
}
|
|
1082
|
+
case 'set_enabled_models': {
|
|
1083
|
+
const validated = validation_1.SetEnabledModelsSchema.parse(args);
|
|
1084
|
+
const result = await this.client.setEnabledModels(validated.models);
|
|
1085
|
+
return this.formatSuccessResponse(result);
|
|
1086
|
+
}
|
|
1087
|
+
case 'get_default_model': {
|
|
1088
|
+
const validated = validation_1.GetDefaultModelSchema.parse(args);
|
|
1089
|
+
const result = await this.client.getDefaultModel({ model_type: validated.model_type });
|
|
1090
|
+
return this.formatSuccessResponse(result);
|
|
1091
|
+
}
|
|
1092
|
+
case 'set_default_model': {
|
|
1093
|
+
const validated = validation_1.SetDefaultModelSchema.parse(args);
|
|
1094
|
+
const result = await this.client.setDefaultModel({
|
|
1095
|
+
provider: validated.provider,
|
|
1096
|
+
model_name: validated.model_name,
|
|
1097
|
+
model_type: validated.model_type
|
|
1098
|
+
});
|
|
1099
|
+
return this.formatSuccessResponse(result);
|
|
1100
|
+
}
|
|
1101
|
+
case 'delete_default_model': {
|
|
1102
|
+
const validated = validation_1.DeleteDefaultModelSchema.parse(args);
|
|
1103
|
+
const result = await this.client.deleteDefaultModel({ model_type: validated.model_type });
|
|
1104
|
+
return this.formatSuccessResponse(result);
|
|
1105
|
+
}
|
|
1106
|
+
case 'get_provider_variable_mapping': {
|
|
1107
|
+
const validated = validation_1.GetProviderVariableMappingSchema.parse(args);
|
|
1108
|
+
const result = await this.client.getProviderVariableMapping(validated.purpose ? { purpose: validated.purpose } : undefined);
|
|
1109
|
+
return this.formatSuccessResponse(result);
|
|
1110
|
+
}
|
|
1111
|
+
case 'validate_model_provider': {
|
|
1112
|
+
const validated = validation_1.ValidateModelProviderSchema.parse(args);
|
|
1113
|
+
const result = await this.client.validateModelProvider({
|
|
1114
|
+
provider: validated.provider,
|
|
1115
|
+
variables: validated.variables
|
|
1116
|
+
});
|
|
1117
|
+
return this.formatSuccessResponse(result);
|
|
1118
|
+
}
|
|
1119
|
+
case 'get_language_model_options': {
|
|
1120
|
+
const validated = validation_1.GetLanguageModelOptionsSchema.parse(args);
|
|
1121
|
+
const result = await this.client.getLanguageModelOptions(validated.purpose ? { purpose: validated.purpose } : undefined);
|
|
1122
|
+
return this.formatSuccessResponse(result);
|
|
1123
|
+
}
|
|
1124
|
+
case 'get_embedding_model_options': {
|
|
1125
|
+
const validated = validation_1.GetEmbeddingModelOptionsSchema.parse(args);
|
|
1126
|
+
const result = await this.client.getEmbeddingModelOptions(validated.purpose ? { purpose: validated.purpose } : undefined);
|
|
1127
|
+
return this.formatSuccessResponse(result);
|
|
1128
|
+
}
|
|
1129
|
+
case 'get_model_provider_policy': {
|
|
1130
|
+
validation_1.GetModelProviderPolicySchema.parse(args);
|
|
1131
|
+
const result = await this.client.getModelProviderPolicy();
|
|
1132
|
+
return this.formatSuccessResponse(result);
|
|
1133
|
+
}
|
|
1134
|
+
case 'replace_model_provider_policy': {
|
|
1135
|
+
const validated = validation_1.ReplaceModelProviderPolicySchema.parse(args);
|
|
1136
|
+
const result = await this.client.replaceModelProviderPolicy(validated);
|
|
1137
|
+
return this.formatSuccessResponse(result);
|
|
1138
|
+
}
|
|
1139
|
+
case 'get_catalog_component_policy': {
|
|
1140
|
+
validation_1.GetCatalogComponentPolicySchema.parse(args);
|
|
1141
|
+
const result = await this.client.getCatalogComponentPolicy();
|
|
1142
|
+
return this.formatSuccessResponse(result);
|
|
1143
|
+
}
|
|
1144
|
+
case 'replace_catalog_component_policy': {
|
|
1145
|
+
const validated = validation_1.ReplaceCatalogComponentPolicySchema.parse(args);
|
|
1146
|
+
const result = await this.client.replaceCatalogComponentPolicy(validated);
|
|
1147
|
+
return this.formatSuccessResponse(result);
|
|
1148
|
+
}
|
|
1149
|
+
case 'get_catalog_template_policy': {
|
|
1150
|
+
validation_1.GetCatalogTemplatePolicySchema.parse(args);
|
|
1151
|
+
const result = await this.client.getCatalogTemplatePolicy();
|
|
1152
|
+
return this.formatSuccessResponse(result);
|
|
1153
|
+
}
|
|
1154
|
+
case 'replace_catalog_template_policy': {
|
|
1155
|
+
const validated = validation_1.ReplaceCatalogTemplatePolicySchema.parse(args);
|
|
1156
|
+
const result = await this.client.replaceCatalogTemplatePolicy(validated);
|
|
1157
|
+
return this.formatSuccessResponse(result);
|
|
1158
|
+
}
|
|
1159
|
+
case 'get_catalog_policy_usage': {
|
|
1160
|
+
validation_1.GetCatalogPolicyUsageSchema.parse(args);
|
|
1161
|
+
const result = await this.client.getCatalogPolicyUsage();
|
|
1162
|
+
return this.formatSuccessResponse(result);
|
|
1163
|
+
}
|
|
1164
|
+
case 'get_catalog_policy_usage_flows': {
|
|
1165
|
+
const validated = validation_1.GetCatalogPolicyUsageFlowsSchema.parse(args);
|
|
1166
|
+
const result = await this.client.getCatalogPolicyUsageFlows(validated);
|
|
1167
|
+
return this.formatSuccessResponse(result);
|
|
1168
|
+
}
|
|
1169
|
+
case 'get_policy_bundle': {
|
|
1170
|
+
validation_1.GetPolicyBundleSchema.parse(args);
|
|
1171
|
+
const result = await this.client.getPolicyBundle();
|
|
1172
|
+
return this.formatSuccessResponse(result);
|
|
1173
|
+
}
|
|
1174
|
+
case 'replace_policy_bundle': {
|
|
1175
|
+
const validated = validation_1.ReplacePolicyBundleSchema.parse(args);
|
|
1176
|
+
const result = await this.client.replacePolicyBundle(validated);
|
|
1177
|
+
return this.formatSuccessResponse(result);
|
|
1178
|
+
}
|
|
1179
|
+
case 'list_policy_bundle_history': {
|
|
1180
|
+
const validated = validation_1.ListPolicyBundleHistorySchema.parse(args);
|
|
1181
|
+
const result = await this.client.listPolicyBundleHistory(validated);
|
|
1182
|
+
return this.formatSuccessResponse(result);
|
|
1183
|
+
}
|
|
1184
|
+
case 'rollback_policy_bundle': {
|
|
1185
|
+
const validated = validation_1.RollbackPolicyBundleSchema.parse(args);
|
|
1186
|
+
const { revision, ...body } = validated;
|
|
1187
|
+
const result = await this.client.rollbackPolicyBundle(revision, body);
|
|
1188
|
+
return this.formatSuccessResponse(result);
|
|
1189
|
+
}
|
|
1190
|
+
case 'agentic_assist': {
|
|
1191
|
+
const validated = validation_1.AgenticAssistSchema.parse(args);
|
|
1192
|
+
const result = await this.client.agenticAssist(validated);
|
|
1193
|
+
return this.formatSuccessResponse(result);
|
|
1194
|
+
}
|
|
1195
|
+
case 'agentic_assist_stream': {
|
|
1196
|
+
const validated = validation_1.AgenticAssistSchema.parse(args);
|
|
1197
|
+
const result = await this.client.agenticAssistStream(validated);
|
|
1198
|
+
return this.formatSuccessResponse(result);
|
|
1199
|
+
}
|
|
1200
|
+
case 'agentic_assist_run': {
|
|
1201
|
+
const validated = validation_1.AgenticAssistRunSchema.parse(args);
|
|
1202
|
+
const result = await this.client.agenticAssistRun(validated);
|
|
1203
|
+
return this.formatSuccessResponse(result);
|
|
1204
|
+
}
|
|
1205
|
+
case 'agentic_check_config': {
|
|
1206
|
+
validation_1.AgenticCheckConfigSchema.parse(args);
|
|
1207
|
+
const result = await this.client.agenticCheckConfig();
|
|
1208
|
+
return this.formatSuccessResponse(result);
|
|
1209
|
+
}
|
|
1210
|
+
case 'agentic_execute': {
|
|
1211
|
+
const validated = validation_1.AgenticExecuteSchema.parse(args);
|
|
1212
|
+
const { flow_name, ...body } = validated;
|
|
1213
|
+
const result = await this.client.agenticExecute(flow_name, body);
|
|
1214
|
+
return this.formatSuccessResponse(result);
|
|
1215
|
+
}
|
|
1216
|
+
case 'get_workflow_result': {
|
|
1217
|
+
const validated = validation_1.GetWorkflowResultSchema.parse(args);
|
|
1218
|
+
const result = await this.client.getWorkflowResult(validated.job_id ? { job_id: validated.job_id } : undefined);
|
|
1219
|
+
return this.formatSuccessResponse(result);
|
|
1220
|
+
}
|
|
1221
|
+
case 'run_workflow': {
|
|
1222
|
+
const validated = validation_1.RunWorkflowSchema.parse(args);
|
|
1223
|
+
const result = await this.client.runWorkflow(validated);
|
|
1224
|
+
return this.formatSuccessResponse(result);
|
|
1225
|
+
}
|
|
1226
|
+
case 'stop_workflow': {
|
|
1227
|
+
const validated = validation_1.StopWorkflowSchema.parse(args);
|
|
1228
|
+
const result = await this.client.stopWorkflow(validated.job_id);
|
|
1229
|
+
return this.formatSuccessResponse(result);
|
|
1230
|
+
}
|
|
1231
|
+
case 'list_mcp_servers': {
|
|
1232
|
+
const validated = validation_1.ListMcpServersSchema.parse(args);
|
|
1233
|
+
const result = await this.client.listMcpServers(validated.action_count !== undefined ? { action_count: validated.action_count } : undefined);
|
|
1234
|
+
return this.formatSuccessResponse(result);
|
|
1235
|
+
}
|
|
1236
|
+
case 'get_mcp_server': {
|
|
1237
|
+
const validated = validation_1.GetMcpServerSchema.parse(args);
|
|
1238
|
+
const result = await this.client.getMcpServer(validated.server_name);
|
|
1239
|
+
return this.formatSuccessResponse(result);
|
|
1240
|
+
}
|
|
1241
|
+
case 'create_mcp_server': {
|
|
1242
|
+
const validated = validation_1.CreateMcpServerSchema.parse(args);
|
|
1243
|
+
const result = await this.client.createMcpServer(validated.server_name, validated.config);
|
|
1244
|
+
return this.formatSuccessResponse(result);
|
|
1245
|
+
}
|
|
1246
|
+
case 'update_mcp_server': {
|
|
1247
|
+
const validated = validation_1.UpdateMcpServerSchema.parse(args);
|
|
1248
|
+
const result = await this.client.updateMcpServer(validated.server_name, validated.config);
|
|
1249
|
+
return this.formatSuccessResponse(result);
|
|
1250
|
+
}
|
|
1251
|
+
case 'delete_mcp_server': {
|
|
1252
|
+
const validated = validation_1.DeleteMcpServerSchema.parse(args);
|
|
1253
|
+
const result = await this.client.deleteMcpServer(validated.server_name);
|
|
1254
|
+
return this.formatSuccessResponse(result);
|
|
1255
|
+
}
|
|
1256
|
+
case 'get_mcp_project_config': {
|
|
1257
|
+
const validated = validation_1.GetMcpProjectConfigSchema.parse(args);
|
|
1258
|
+
const result = await this.client.getMcpProjectConfig(validated.project_id, validated.mcp_enabled !== undefined ? { mcp_enabled: validated.mcp_enabled } : undefined);
|
|
1259
|
+
return this.formatSuccessResponse(result);
|
|
1260
|
+
}
|
|
1261
|
+
case 'update_mcp_project_config': {
|
|
1262
|
+
const validated = validation_1.UpdateMcpProjectConfigSchema.parse(args);
|
|
1263
|
+
const result = await this.client.updateMcpProjectConfig(validated.project_id, {
|
|
1264
|
+
settings: validated.settings,
|
|
1265
|
+
auth_settings: validated.auth_settings
|
|
1266
|
+
});
|
|
1267
|
+
return this.formatSuccessResponse(result);
|
|
1268
|
+
}
|
|
1269
|
+
case 'get_mcp_project_installed': {
|
|
1270
|
+
const validated = validation_1.GetMcpProjectInstalledSchema.parse(args);
|
|
1271
|
+
const result = await this.client.getMcpProjectInstalled(validated.project_id);
|
|
1272
|
+
return this.formatSuccessResponse(result);
|
|
1273
|
+
}
|
|
1274
|
+
case 'install_mcp_project': {
|
|
1275
|
+
const validated = validation_1.InstallMcpProjectSchema.parse(args);
|
|
1276
|
+
const result = await this.client.installMcpProject(validated.project_id, {
|
|
1277
|
+
client: validated.client,
|
|
1278
|
+
transport: validated.transport
|
|
1279
|
+
});
|
|
1280
|
+
return this.formatSuccessResponse(result);
|
|
1281
|
+
}
|
|
1282
|
+
case 'get_mcp_project_composer_url': {
|
|
1283
|
+
const validated = validation_1.GetMcpProjectComposerUrlSchema.parse(args);
|
|
1284
|
+
const result = await this.client.getMcpProjectComposerUrl(validated.project_id);
|
|
1285
|
+
return this.formatSuccessResponse(result);
|
|
1286
|
+
}
|
|
1287
|
+
case 'list_authz_roles': {
|
|
1288
|
+
const validated = validation_1.ListAuthzRolesSchema.parse(args);
|
|
1289
|
+
const result = await this.client.listAuthzRoles(validated);
|
|
1290
|
+
return this.formatSuccessResponse(result);
|
|
1291
|
+
}
|
|
1292
|
+
case 'get_authz_role': {
|
|
1293
|
+
const validated = validation_1.GetAuthzRoleSchema.parse(args);
|
|
1294
|
+
const result = await this.client.getAuthzRole(validated.role_id);
|
|
1295
|
+
return this.formatSuccessResponse(result);
|
|
1296
|
+
}
|
|
1297
|
+
case 'create_authz_role': {
|
|
1298
|
+
const validated = validation_1.CreateAuthzRoleSchema.parse(args);
|
|
1299
|
+
const result = await this.client.createAuthzRole(validated);
|
|
1300
|
+
return this.formatSuccessResponse(result);
|
|
1301
|
+
}
|
|
1302
|
+
case 'update_authz_role': {
|
|
1303
|
+
const validated = validation_1.UpdateAuthzRoleSchema.parse(args);
|
|
1304
|
+
const { role_id, ...body } = validated;
|
|
1305
|
+
const result = await this.client.updateAuthzRole(role_id, body);
|
|
1306
|
+
return this.formatSuccessResponse(result);
|
|
1307
|
+
}
|
|
1308
|
+
case 'delete_authz_role': {
|
|
1309
|
+
const validated = validation_1.DeleteAuthzRoleSchema.parse(args);
|
|
1310
|
+
await this.client.deleteAuthzRole(validated.role_id);
|
|
1311
|
+
return this.formatSuccessResponse({
|
|
1312
|
+
success: true,
|
|
1313
|
+
message: 'Role deleted successfully'
|
|
1314
|
+
});
|
|
1315
|
+
}
|
|
1316
|
+
case 'list_authz_role_assignments': {
|
|
1317
|
+
const validated = validation_1.ListAuthzRoleAssignmentsSchema.parse(args);
|
|
1318
|
+
const result = await this.client.listAuthzRoleAssignments(validated);
|
|
1319
|
+
return this.formatSuccessResponse(result);
|
|
1320
|
+
}
|
|
1321
|
+
case 'create_authz_role_assignment': {
|
|
1322
|
+
const validated = validation_1.CreateAuthzRoleAssignmentSchema.parse(args);
|
|
1323
|
+
const result = await this.client.createAuthzRoleAssignment(validated);
|
|
1324
|
+
return this.formatSuccessResponse(result);
|
|
1325
|
+
}
|
|
1326
|
+
case 'delete_authz_role_assignment': {
|
|
1327
|
+
const validated = validation_1.DeleteAuthzRoleAssignmentSchema.parse(args);
|
|
1328
|
+
await this.client.deleteAuthzRoleAssignment(validated.assignment_id);
|
|
1329
|
+
return this.formatSuccessResponse({
|
|
1330
|
+
success: true,
|
|
1331
|
+
message: 'Role assignment deleted successfully'
|
|
1332
|
+
});
|
|
1333
|
+
}
|
|
1334
|
+
case 'list_authz_teams': {
|
|
1335
|
+
const validated = validation_1.ListAuthzTeamsSchema.parse(args);
|
|
1336
|
+
const result = await this.client.listAuthzTeams(validated);
|
|
1337
|
+
return this.formatSuccessResponse(result);
|
|
1338
|
+
}
|
|
1339
|
+
case 'get_authz_team': {
|
|
1340
|
+
const validated = validation_1.GetAuthzTeamSchema.parse(args);
|
|
1341
|
+
const result = await this.client.getAuthzTeam(validated.team_id);
|
|
1342
|
+
return this.formatSuccessResponse(result);
|
|
1343
|
+
}
|
|
1344
|
+
case 'create_authz_team': {
|
|
1345
|
+
const validated = validation_1.CreateAuthzTeamSchema.parse(args);
|
|
1346
|
+
const result = await this.client.createAuthzTeam(validated);
|
|
1347
|
+
return this.formatSuccessResponse(result);
|
|
1348
|
+
}
|
|
1349
|
+
case 'update_authz_team': {
|
|
1350
|
+
const validated = validation_1.UpdateAuthzTeamSchema.parse(args);
|
|
1351
|
+
const { team_id, ...body } = validated;
|
|
1352
|
+
const result = await this.client.updateAuthzTeam(team_id, body);
|
|
1353
|
+
return this.formatSuccessResponse(result);
|
|
1354
|
+
}
|
|
1355
|
+
case 'delete_authz_team': {
|
|
1356
|
+
const validated = validation_1.DeleteAuthzTeamSchema.parse(args);
|
|
1357
|
+
await this.client.deleteAuthzTeam(validated.team_id);
|
|
1358
|
+
return this.formatSuccessResponse({
|
|
1359
|
+
success: true,
|
|
1360
|
+
message: 'Team deleted successfully'
|
|
1361
|
+
});
|
|
1362
|
+
}
|
|
1363
|
+
case 'list_authz_team_members': {
|
|
1364
|
+
const validated = validation_1.ListAuthzTeamMembersSchema.parse(args);
|
|
1365
|
+
const { team_id, ...params } = validated;
|
|
1366
|
+
const result = await this.client.listAuthzTeamMembers(team_id, params);
|
|
1367
|
+
return this.formatSuccessResponse(result);
|
|
1368
|
+
}
|
|
1369
|
+
case 'add_authz_team_member': {
|
|
1370
|
+
const validated = validation_1.AddAuthzTeamMemberSchema.parse(args);
|
|
1371
|
+
const { team_id, ...body } = validated;
|
|
1372
|
+
const result = await this.client.addAuthzTeamMember(team_id, body);
|
|
1373
|
+
return this.formatSuccessResponse(result);
|
|
1374
|
+
}
|
|
1375
|
+
case 'remove_authz_team_member': {
|
|
1376
|
+
const validated = validation_1.RemoveAuthzTeamMemberSchema.parse(args);
|
|
1377
|
+
await this.client.removeAuthzTeamMember(validated.team_id, validated.user_id);
|
|
1378
|
+
return this.formatSuccessResponse({
|
|
1379
|
+
success: true,
|
|
1380
|
+
message: 'Team member removed successfully'
|
|
1381
|
+
});
|
|
1382
|
+
}
|
|
1383
|
+
case 'list_authz_shares': {
|
|
1384
|
+
const validated = validation_1.ListAuthzSharesSchema.parse(args);
|
|
1385
|
+
const result = await this.client.listAuthzShares(validated);
|
|
1386
|
+
return this.formatSuccessResponse(result);
|
|
1387
|
+
}
|
|
1388
|
+
case 'get_authz_share': {
|
|
1389
|
+
const validated = validation_1.GetAuthzShareSchema.parse(args);
|
|
1390
|
+
const result = await this.client.getAuthzShare(validated.share_id);
|
|
1391
|
+
return this.formatSuccessResponse(result);
|
|
1392
|
+
}
|
|
1393
|
+
case 'create_authz_share': {
|
|
1394
|
+
const validated = validation_1.CreateAuthzShareSchema.parse(args);
|
|
1395
|
+
const result = await this.client.createAuthzShare(validated);
|
|
1396
|
+
return this.formatSuccessResponse(result);
|
|
1397
|
+
}
|
|
1398
|
+
case 'update_authz_share': {
|
|
1399
|
+
const validated = validation_1.UpdateAuthzShareSchema.parse(args);
|
|
1400
|
+
const result = await this.client.updateAuthzShare(validated.share_id, {
|
|
1401
|
+
permission_level: validated.permission_level
|
|
1402
|
+
});
|
|
1403
|
+
return this.formatSuccessResponse(result);
|
|
1404
|
+
}
|
|
1405
|
+
case 'delete_authz_share': {
|
|
1406
|
+
const validated = validation_1.DeleteAuthzShareSchema.parse(args);
|
|
1407
|
+
await this.client.deleteAuthzShare(validated.share_id);
|
|
1408
|
+
return this.formatSuccessResponse({
|
|
1409
|
+
success: true,
|
|
1410
|
+
message: 'Share deleted successfully'
|
|
1411
|
+
});
|
|
1412
|
+
}
|
|
1413
|
+
case 'get_authz_audit': {
|
|
1414
|
+
const validated = validation_1.GetAuthzAuditSchema.parse(args);
|
|
1415
|
+
const result = await this.client.getAuthzAudit(validated);
|
|
1416
|
+
return this.formatSuccessResponse(result);
|
|
1417
|
+
}
|
|
1418
|
+
case 'get_my_permissions': {
|
|
1419
|
+
const validated = validation_1.GetMyPermissionsSchema.parse(args);
|
|
1420
|
+
const result = await this.client.getMyPermissions(validated);
|
|
1421
|
+
return this.formatSuccessResponse(result);
|
|
1422
|
+
}
|
|
1423
|
+
case 'create_memory_base': {
|
|
1424
|
+
const validated = validation_1.CreateMemoryBaseSchema.parse(args);
|
|
1425
|
+
const result = await this.client.createMemoryBase(validated);
|
|
1426
|
+
return this.formatSuccessResponse(result);
|
|
1427
|
+
}
|
|
1428
|
+
case 'list_memory_bases': {
|
|
1429
|
+
const validated = validation_1.ListMemoryBasesSchema.parse(args);
|
|
1430
|
+
const result = await this.client.listMemoryBases(validated);
|
|
1431
|
+
return this.formatSuccessResponse(result);
|
|
1432
|
+
}
|
|
1433
|
+
case 'get_memory_base': {
|
|
1434
|
+
const validated = validation_1.GetMemoryBaseSchema.parse(args);
|
|
1435
|
+
const result = await this.client.getMemoryBase(validated.memory_base_id);
|
|
1436
|
+
return this.formatSuccessResponse(result);
|
|
1437
|
+
}
|
|
1438
|
+
case 'list_memory_base_sessions': {
|
|
1439
|
+
const validated = validation_1.ListMemoryBaseSessionsSchema.parse(args);
|
|
1440
|
+
const { memory_base_id, ...params } = validated;
|
|
1441
|
+
const result = await this.client.listMemoryBaseSessions(memory_base_id, params);
|
|
1442
|
+
return this.formatSuccessResponse(result);
|
|
1443
|
+
}
|
|
1444
|
+
case 'list_memory_base_messages': {
|
|
1445
|
+
const validated = validation_1.ListMemoryBaseMessagesSchema.parse(args);
|
|
1446
|
+
const { memory_base_id, ...params } = validated;
|
|
1447
|
+
const result = await this.client.listMemoryBaseMessages(memory_base_id, params);
|
|
1448
|
+
return this.formatSuccessResponse(result);
|
|
1449
|
+
}
|
|
1450
|
+
case 'update_memory_base': {
|
|
1451
|
+
const validated = validation_1.UpdateMemoryBaseSchema.parse(args);
|
|
1452
|
+
const { memory_base_id, ...body } = validated;
|
|
1453
|
+
const result = await this.client.updateMemoryBase(memory_base_id, body);
|
|
1454
|
+
return this.formatSuccessResponse(result);
|
|
1455
|
+
}
|
|
1456
|
+
case 'delete_memory_base': {
|
|
1457
|
+
const validated = validation_1.DeleteMemoryBaseSchema.parse(args);
|
|
1458
|
+
await this.client.deleteMemoryBase(validated.memory_base_id);
|
|
1459
|
+
return this.formatSuccessResponse({
|
|
1460
|
+
success: true,
|
|
1461
|
+
message: 'Memory base deleted successfully'
|
|
1462
|
+
});
|
|
1463
|
+
}
|
|
1464
|
+
case 'flush_memory_base': {
|
|
1465
|
+
const validated = validation_1.FlushMemoryBaseSchema.parse(args);
|
|
1466
|
+
const result = await this.client.flushMemoryBase(validated.memory_base_id, {
|
|
1467
|
+
session_id: validated.session_id
|
|
1468
|
+
});
|
|
1469
|
+
return this.formatSuccessResponse(result);
|
|
1470
|
+
}
|
|
1471
|
+
case 'check_memory_base_mismatch': {
|
|
1472
|
+
const validated = validation_1.CheckMemoryBaseMismatchSchema.parse(args);
|
|
1473
|
+
const result = await this.client.checkMemoryBaseMismatch(validated.memory_base_id);
|
|
1474
|
+
return this.formatSuccessResponse(result);
|
|
1475
|
+
}
|
|
1476
|
+
case 'regenerate_memory_base': {
|
|
1477
|
+
const validated = validation_1.RegenerateMemoryBaseSchema.parse(args);
|
|
1478
|
+
const result = await this.client.regenerateMemoryBase(validated.memory_base_id);
|
|
1479
|
+
return this.formatSuccessResponse(result);
|
|
1480
|
+
}
|
|
1481
|
+
case 'test_knowledge_base_connection': {
|
|
1482
|
+
const validated = validation_1.TestKnowledgeBaseConnectionSchema.parse(args);
|
|
1483
|
+
const result = await this.client.testKnowledgeBaseConnection(validated);
|
|
1484
|
+
return this.formatSuccessResponse(result);
|
|
1485
|
+
}
|
|
1486
|
+
case 'list_knowledge_base_connectors': {
|
|
1487
|
+
validation_1.ListKnowledgeBaseConnectorsSchema.parse(args);
|
|
1488
|
+
const result = await this.client.listKnowledgeBaseConnectors();
|
|
1489
|
+
return this.formatSuccessResponse(result);
|
|
1490
|
+
}
|
|
1491
|
+
case 'ingest_knowledge_base_folder': {
|
|
1492
|
+
const validated = validation_1.IngestKnowledgeBaseFolderSchema.parse(args);
|
|
1493
|
+
const { kb_name, ...body } = validated;
|
|
1494
|
+
const result = await this.client.ingestKnowledgeBaseFolder(kb_name, body);
|
|
1495
|
+
return this.formatSuccessResponse(result);
|
|
1496
|
+
}
|
|
1497
|
+
case 'ingest_knowledge_base_connector': {
|
|
1498
|
+
const validated = validation_1.IngestKnowledgeBaseConnectorSchema.parse(args);
|
|
1499
|
+
const { kb_name, ...body } = validated;
|
|
1500
|
+
const result = await this.client.ingestKnowledgeBaseConnector(kb_name, body);
|
|
1501
|
+
return this.formatSuccessResponse(result);
|
|
1502
|
+
}
|
|
1503
|
+
case 'get_knowledge_base_metadata_keys': {
|
|
1504
|
+
const validated = validation_1.GetKnowledgeBaseMetadataKeysSchema.parse(args);
|
|
1505
|
+
const result = await this.client.getKnowledgeBaseMetadataKeys(validated.kb_name);
|
|
1506
|
+
return this.formatSuccessResponse(result);
|
|
1507
|
+
}
|
|
1508
|
+
case 'list_knowledge_base_runs': {
|
|
1509
|
+
const validated = validation_1.ListKnowledgeBaseRunsSchema.parse(args);
|
|
1510
|
+
const { kb_name, ...params } = validated;
|
|
1511
|
+
const result = await this.client.listKnowledgeBaseRuns(kb_name, params);
|
|
1512
|
+
return this.formatSuccessResponse(result);
|
|
1513
|
+
}
|
|
1514
|
+
case 'get_knowledge_base_run': {
|
|
1515
|
+
const validated = validation_1.GetKnowledgeBaseRunSchema.parse(args);
|
|
1516
|
+
const result = await this.client.getKnowledgeBaseRun(validated.kb_name, validated.run_id);
|
|
1517
|
+
return this.formatSuccessResponse(result);
|
|
1518
|
+
}
|
|
1519
|
+
case 'reload_extension_bundle': {
|
|
1520
|
+
const validated = validation_1.ReloadExtensionBundleSchema.parse(args);
|
|
1521
|
+
const result = await this.client.reloadExtensionBundle(validated.extension_id, validated.bundle_name);
|
|
1522
|
+
return this.formatSuccessResponse(result);
|
|
1523
|
+
}
|
|
1524
|
+
case 'get_extension_events': {
|
|
1525
|
+
const validated = validation_1.GetExtensionEventsSchema.parse(args);
|
|
1526
|
+
const result = await this.client.getExtensionEvents(validated);
|
|
1527
|
+
return this.formatSuccessResponse(result);
|
|
1528
|
+
}
|
|
1529
|
+
case 'get_agentic_file': {
|
|
1530
|
+
const validated = validation_1.GetAgenticFileSchema.parse(args);
|
|
1531
|
+
const result = await this.client.getAgenticFile(validated);
|
|
1532
|
+
return this.formatSuccessResponse(result);
|
|
1533
|
+
}
|
|
1534
|
+
case 'reset_agentic_session': {
|
|
1535
|
+
const validated = validation_1.ResetAgenticSessionSchema.parse(args);
|
|
1536
|
+
const result = await this.client.resetAgenticSession(validated);
|
|
1537
|
+
return this.formatSuccessResponse(result);
|
|
1538
|
+
}
|
|
1539
|
+
case 'get_flow_note_translations': {
|
|
1540
|
+
const validated = validation_1.GetFlowNoteTranslationsSchema.parse(args);
|
|
1541
|
+
const result = await this.client.getFlowNoteTranslations(validated.flow_id);
|
|
1542
|
+
return this.formatSuccessResponse(result);
|
|
1543
|
+
}
|
|
1544
|
+
case 'get_job_queue_metrics': {
|
|
1545
|
+
validation_1.GetJobQueueMetricsSchema.parse(args);
|
|
1546
|
+
const result = await this.client.getJobQueueMetrics();
|
|
1547
|
+
return this.formatSuccessResponse(result);
|
|
1548
|
+
}
|
|
1549
|
+
case 'list_a2a_agents': {
|
|
1550
|
+
validation_1.ListA2aAgentsSchema.parse(args);
|
|
1551
|
+
const result = await this.client.listA2aAgents();
|
|
1552
|
+
return this.formatSuccessResponse(result);
|
|
1553
|
+
}
|
|
1554
|
+
case 'get_a2a_agent_card': {
|
|
1555
|
+
const validated = validation_1.GetA2aAgentCardSchema.parse(args);
|
|
1556
|
+
const result = await this.client.getA2aAgentCard(validated.flow_id);
|
|
1557
|
+
return this.formatSuccessResponse(result);
|
|
1558
|
+
}
|
|
1559
|
+
case 'invoke_a2a_jsonrpc': {
|
|
1560
|
+
const validated = validation_1.InvokeA2aJsonrpcSchema.parse(args);
|
|
1561
|
+
const { flow_id, ...body } = validated;
|
|
1562
|
+
const result = await this.client.invokeA2aJsonrpc(flow_id, body);
|
|
1563
|
+
return this.formatSuccessResponse(result);
|
|
1564
|
+
}
|
|
1565
|
+
case 'list_pending_workflows': {
|
|
1566
|
+
const validated = validation_1.ListPendingWorkflowsSchema.parse(args);
|
|
1567
|
+
const result = await this.client.listPendingWorkflows({ flow_id: validated.flow_id });
|
|
1568
|
+
return this.formatSuccessResponse(result);
|
|
1569
|
+
}
|
|
1570
|
+
case 'get_workflow_events': {
|
|
1571
|
+
const validated = validation_1.GetWorkflowEventsSchema.parse(args);
|
|
1572
|
+
const result = await this.client.getWorkflowEvents(validated.job_id);
|
|
1573
|
+
return this.formatSuccessResponse(result);
|
|
1574
|
+
}
|
|
1575
|
+
case 'resume_workflow': {
|
|
1576
|
+
const validated = validation_1.ResumeWorkflowSchema.parse(args);
|
|
1577
|
+
const { job_id, ...body } = validated;
|
|
1578
|
+
const result = await this.client.resumeWorkflow(job_id, body);
|
|
1579
|
+
return this.formatSuccessResponse(result);
|
|
1580
|
+
}
|
|
1581
|
+
case 'run_public_workflow': {
|
|
1582
|
+
const validated = validation_1.RunPublicWorkflowSchema.parse(args);
|
|
1583
|
+
const result = await this.client.runPublicWorkflow(validated);
|
|
1584
|
+
return this.formatSuccessResponse(result);
|
|
1585
|
+
}
|
|
782
1586
|
default:
|
|
783
1587
|
throw new Error(`Unknown tool: ${name}`);
|
|
784
1588
|
}
|
|
@@ -793,6 +1597,9 @@ class LangflowMCPServer {
|
|
|
793
1597
|
await this.server.connect(transport);
|
|
794
1598
|
logger_1.logger.info('Langflow MCP server running on stdio');
|
|
795
1599
|
}
|
|
1600
|
+
async connectTransport(transport) {
|
|
1601
|
+
await this.server.connect(transport);
|
|
1602
|
+
}
|
|
796
1603
|
async shutdown() {
|
|
797
1604
|
logger_1.logger.info('Shutting down Langflow MCP server');
|
|
798
1605
|
await this.server.close();
|