@burdenoff/mcp-libs 2026.1110.2 → 2026.1110.3
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/dist/modules/bigconsole/index.cjs +1135 -0
- package/dist/modules/bigconsole/index.cjs.map +1 -1
- package/dist/modules/bigconsole/index.js +1135 -0
- package/dist/modules/bigconsole/index.js.map +1 -1
- package/dist/modules/bigconsole/operations.d.ts +32 -0
- package/dist/modules/bigconsole/tools/call.d.ts +19 -0
- package/dist/modules/bigconsole/tools/linked-workflows.d.ts +3 -0
- package/dist/modules/bigconsole/tools/pipelines.d.ts +3 -0
- package/dist/modules/bigconsole/tools/prompts.d.ts +3 -0
- package/dist/modules/bigconsole/tools/shared.d.ts +26 -0
- package/dist/modules/kadaikodi/tools/shared.d.ts +1 -1
- package/dist/modules/theglobalfuel/tools/shared.d.ts +1 -1
- package/package.json +1 -1
|
@@ -366,6 +366,464 @@ var CREATE_DASHBOARD_FROM_GENERATION = `
|
|
|
366
366
|
}
|
|
367
367
|
}
|
|
368
368
|
`;
|
|
369
|
+
var UPDATE_DASHBOARD = `
|
|
370
|
+
mutation BigConsoleMcpUpdateDashboard($input: BigConsoleUpdateDashboardInput!) {
|
|
371
|
+
updateBigConsoleDashboard(input: $input) {
|
|
372
|
+
id
|
|
373
|
+
name
|
|
374
|
+
description
|
|
375
|
+
category
|
|
376
|
+
visibility
|
|
377
|
+
status
|
|
378
|
+
version
|
|
379
|
+
updatedAt
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
`;
|
|
383
|
+
var CLONE_DASHBOARD = `
|
|
384
|
+
mutation BigConsoleMcpCloneDashboard($input: BigConsoleCloneDashboardInput!) {
|
|
385
|
+
cloneDashboard(input: $input) {
|
|
386
|
+
id
|
|
387
|
+
name
|
|
388
|
+
description
|
|
389
|
+
category
|
|
390
|
+
createdAt
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
`;
|
|
394
|
+
var SEARCH_DASHBOARDS = `
|
|
395
|
+
query BigConsoleMcpSearchDashboards(
|
|
396
|
+
$query: String!
|
|
397
|
+
$category: BigConsoleDashboardCategory
|
|
398
|
+
$visibility: BigConsoleDashboardVisibility
|
|
399
|
+
$first: Int
|
|
400
|
+
$after: String
|
|
401
|
+
) {
|
|
402
|
+
searchDashboards(
|
|
403
|
+
query: $query
|
|
404
|
+
category: $category
|
|
405
|
+
visibility: $visibility
|
|
406
|
+
first: $first
|
|
407
|
+
after: $after
|
|
408
|
+
) {
|
|
409
|
+
id
|
|
410
|
+
name
|
|
411
|
+
description
|
|
412
|
+
category
|
|
413
|
+
visibility
|
|
414
|
+
status
|
|
415
|
+
createdAt
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
`;
|
|
419
|
+
var GET_WIDGET = `
|
|
420
|
+
query BigConsoleMcpGetWidget($id: ID!) {
|
|
421
|
+
getWidget(id: $id) {
|
|
422
|
+
id
|
|
423
|
+
pageId
|
|
424
|
+
dashboardId
|
|
425
|
+
type
|
|
426
|
+
title
|
|
427
|
+
renderer
|
|
428
|
+
config
|
|
429
|
+
position
|
|
430
|
+
dataSinkId
|
|
431
|
+
parserId
|
|
432
|
+
refreshInterval
|
|
433
|
+
lastRefreshedAt
|
|
434
|
+
createdAt
|
|
435
|
+
updatedAt
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
`;
|
|
439
|
+
var LIST_WIDGETS_BY_DASHBOARD = `
|
|
440
|
+
query BigConsoleMcpListWidgetsByDashboard($dashboardId: ID!, $type: BigConsoleWidgetType) {
|
|
441
|
+
listWidgetsByDashboard(dashboardId: $dashboardId, type: $type) {
|
|
442
|
+
id
|
|
443
|
+
pageId
|
|
444
|
+
type
|
|
445
|
+
title
|
|
446
|
+
renderer
|
|
447
|
+
position
|
|
448
|
+
dataSinkId
|
|
449
|
+
parserId
|
|
450
|
+
updatedAt
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
`;
|
|
454
|
+
var UPDATE_WIDGET = `
|
|
455
|
+
mutation BigConsoleMcpUpdateWidget($input: BigConsoleUpdateWidgetInput!) {
|
|
456
|
+
updateBigConsoleWidget(input: $input) {
|
|
457
|
+
id
|
|
458
|
+
type
|
|
459
|
+
title
|
|
460
|
+
position
|
|
461
|
+
updatedAt
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
`;
|
|
465
|
+
var DUPLICATE_WIDGET = `
|
|
466
|
+
mutation BigConsoleMcpDuplicateWidget(
|
|
467
|
+
$id: ID!
|
|
468
|
+
$newPosition: BigConsoleWidgetPositionInput
|
|
469
|
+
$newTitle: String
|
|
470
|
+
) {
|
|
471
|
+
duplicateWidget(id: $id, newPosition: $newPosition, newTitle: $newTitle) {
|
|
472
|
+
id
|
|
473
|
+
pageId
|
|
474
|
+
type
|
|
475
|
+
title
|
|
476
|
+
position
|
|
477
|
+
createdAt
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
`;
|
|
481
|
+
var REFRESH_WIDGET_DATA = `
|
|
482
|
+
mutation BigConsoleMcpRefreshWidgetData($widgetId: ID!) {
|
|
483
|
+
refreshWidgetData(widgetId: $widgetId) {
|
|
484
|
+
fetchedAt
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
`;
|
|
488
|
+
var GET_WIDGET_TYPES = `
|
|
489
|
+
query BigConsoleMcpGetWidgetTypes {
|
|
490
|
+
getWidgetTypes {
|
|
491
|
+
type
|
|
492
|
+
label
|
|
493
|
+
category
|
|
494
|
+
description
|
|
495
|
+
defaultConfig
|
|
496
|
+
defaultSize {
|
|
497
|
+
width
|
|
498
|
+
height
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
`;
|
|
503
|
+
var GET_WIDGET_RENDERERS = `
|
|
504
|
+
query BigConsoleMcpGetWidgetRenderers {
|
|
505
|
+
getAvailableRenderers {
|
|
506
|
+
type
|
|
507
|
+
name
|
|
508
|
+
description
|
|
509
|
+
supportedWidgetTypes
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
`;
|
|
513
|
+
var REFRESH_DATA_SINK = `
|
|
514
|
+
mutation BigConsoleMcpRefreshDataSink($input: RefreshDataSinkInput!) {
|
|
515
|
+
refreshDataSink(input: $input) {
|
|
516
|
+
id
|
|
517
|
+
key
|
|
518
|
+
name
|
|
519
|
+
status
|
|
520
|
+
lastRefreshedAt
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
`;
|
|
524
|
+
var INVALIDATE_DATA_SINK_CACHE = `
|
|
525
|
+
mutation BigConsoleMcpInvalidateDataSinkCache($id: ID) {
|
|
526
|
+
invalidateDataSinkCache(id: $id) {
|
|
527
|
+
success
|
|
528
|
+
count
|
|
529
|
+
invalidatedIds
|
|
530
|
+
message
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
`;
|
|
534
|
+
var GET_PARSER = `
|
|
535
|
+
query BigConsoleMcpGetParser($id: ID!) {
|
|
536
|
+
parser(id: $id) {
|
|
537
|
+
id
|
|
538
|
+
consoleId
|
|
539
|
+
name
|
|
540
|
+
description
|
|
541
|
+
type
|
|
542
|
+
expression
|
|
543
|
+
inputSinkKey
|
|
544
|
+
outputKey
|
|
545
|
+
outputWidgetId
|
|
546
|
+
ttl
|
|
547
|
+
status
|
|
548
|
+
version
|
|
549
|
+
createdAt
|
|
550
|
+
updatedAt
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
`;
|
|
554
|
+
var EXECUTE_PARSER = `
|
|
555
|
+
mutation BigConsoleMcpExecuteParser($id: ID!) {
|
|
556
|
+
executeParser(id: $id) {
|
|
557
|
+
success
|
|
558
|
+
error
|
|
559
|
+
executionTimeMs
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
`;
|
|
563
|
+
var GET_PIPELINE = `
|
|
564
|
+
query BigConsoleMcpGetPipeline($id: ID!) {
|
|
565
|
+
pipeline(id: $id) {
|
|
566
|
+
id
|
|
567
|
+
consoleId
|
|
568
|
+
name
|
|
569
|
+
description
|
|
570
|
+
status
|
|
571
|
+
stages {
|
|
572
|
+
id
|
|
573
|
+
position
|
|
574
|
+
parserId
|
|
575
|
+
parserName
|
|
576
|
+
parserType
|
|
577
|
+
expression
|
|
578
|
+
inputKey
|
|
579
|
+
outputKey
|
|
580
|
+
enabled
|
|
581
|
+
onError
|
|
582
|
+
fallbackValue
|
|
583
|
+
description
|
|
584
|
+
}
|
|
585
|
+
lastExecutedAt
|
|
586
|
+
version
|
|
587
|
+
createdAt
|
|
588
|
+
updatedAt
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
`;
|
|
592
|
+
var LIST_PIPELINES = `
|
|
593
|
+
query BigConsoleMcpListPipelines($filter: PipelineFilterInput, $first: Int, $after: String) {
|
|
594
|
+
listPipelines(filter: $filter, first: $first, after: $after) {
|
|
595
|
+
edges {
|
|
596
|
+
node {
|
|
597
|
+
id
|
|
598
|
+
consoleId
|
|
599
|
+
name
|
|
600
|
+
description
|
|
601
|
+
status
|
|
602
|
+
lastExecutedAt
|
|
603
|
+
version
|
|
604
|
+
updatedAt
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
totalCount
|
|
608
|
+
pageInfo {
|
|
609
|
+
hasNextPage
|
|
610
|
+
endCursor
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
`;
|
|
615
|
+
var CREATE_PIPELINE = `
|
|
616
|
+
mutation BigConsoleMcpCreatePipeline($input: CreatePipelineInput!) {
|
|
617
|
+
createPipeline(input: $input) {
|
|
618
|
+
id
|
|
619
|
+
consoleId
|
|
620
|
+
name
|
|
621
|
+
status
|
|
622
|
+
version
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
`;
|
|
626
|
+
var UPDATE_PIPELINE = `
|
|
627
|
+
mutation BigConsoleMcpUpdatePipeline($id: ID!, $input: UpdatePipelineInput!, $version: Int!) {
|
|
628
|
+
updatePipeline(id: $id, input: $input, version: $version) {
|
|
629
|
+
id
|
|
630
|
+
name
|
|
631
|
+
status
|
|
632
|
+
version
|
|
633
|
+
updatedAt
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
`;
|
|
637
|
+
var EXECUTE_PIPELINE = `
|
|
638
|
+
mutation BigConsoleMcpExecutePipeline($input: ExecutePipelineInput!) {
|
|
639
|
+
executePipeline(input: $input) {
|
|
640
|
+
id
|
|
641
|
+
pipelineId
|
|
642
|
+
status
|
|
643
|
+
startedAt
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
`;
|
|
647
|
+
var TEST_PIPELINE = `
|
|
648
|
+
mutation BigConsoleMcpTestPipeline($input: TestPipelineInput!) {
|
|
649
|
+
testPipeline(input: $input) {
|
|
650
|
+
id
|
|
651
|
+
pipelineId
|
|
652
|
+
status
|
|
653
|
+
startedAt
|
|
654
|
+
completedAt
|
|
655
|
+
totalExecutionTimeMs
|
|
656
|
+
error
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
`;
|
|
660
|
+
var LIST_PIPELINE_EXECUTIONS = `
|
|
661
|
+
query BigConsoleMcpListPipelineExecutions($pipelineId: ID!, $first: Int, $after: String) {
|
|
662
|
+
listPipelineExecutions(pipelineId: $pipelineId, first: $first, after: $after) {
|
|
663
|
+
id
|
|
664
|
+
pipelineVersion
|
|
665
|
+
status
|
|
666
|
+
startedAt
|
|
667
|
+
completedAt
|
|
668
|
+
totalExecutionTimeMs
|
|
669
|
+
error
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
`;
|
|
673
|
+
var GET_LINKED_WORKFLOW = `
|
|
674
|
+
query BigConsoleMcpGetLinkedWorkflow($id: ID!) {
|
|
675
|
+
workflow(id: $id) {
|
|
676
|
+
id
|
|
677
|
+
name
|
|
678
|
+
key
|
|
679
|
+
description
|
|
680
|
+
externalWorkflowId
|
|
681
|
+
status
|
|
682
|
+
lastExecutedAt
|
|
683
|
+
lastExecutionId
|
|
684
|
+
executionCount
|
|
685
|
+
linkedDataSinkCount
|
|
686
|
+
version
|
|
687
|
+
createdAt
|
|
688
|
+
updatedAt
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
`;
|
|
692
|
+
var LIST_LINKED_WORKFLOWS = `
|
|
693
|
+
query BigConsoleMcpListLinkedWorkflows($filter: FluidGridsWorkflowFilterInput) {
|
|
694
|
+
workflows(filter: $filter) {
|
|
695
|
+
id
|
|
696
|
+
name
|
|
697
|
+
key
|
|
698
|
+
description
|
|
699
|
+
status
|
|
700
|
+
lastExecutedAt
|
|
701
|
+
executionCount
|
|
702
|
+
linkedDataSinkCount
|
|
703
|
+
version
|
|
704
|
+
updatedAt
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
`;
|
|
708
|
+
var GET_LINKED_WORKFLOW_BY_KEY = `
|
|
709
|
+
query BigConsoleMcpGetLinkedWorkflowByKey($key: String!) {
|
|
710
|
+
workflowByKey(key: $key) {
|
|
711
|
+
id
|
|
712
|
+
name
|
|
713
|
+
key
|
|
714
|
+
description
|
|
715
|
+
externalWorkflowId
|
|
716
|
+
status
|
|
717
|
+
lastExecutedAt
|
|
718
|
+
executionCount
|
|
719
|
+
linkedDataSinkCount
|
|
720
|
+
version
|
|
721
|
+
updatedAt
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
`;
|
|
725
|
+
var LIST_LINKED_WORKFLOW_DATA_SINK_LINKS = `
|
|
726
|
+
query BigConsoleMcpListLinkedWorkflowDataSinkLinks($workflowId: ID!) {
|
|
727
|
+
workflowDataSinkLinks(workflowId: $workflowId) {
|
|
728
|
+
id
|
|
729
|
+
dataSinkId
|
|
730
|
+
workflowId
|
|
731
|
+
isEnabled
|
|
732
|
+
priority
|
|
733
|
+
dataMapping
|
|
734
|
+
updatedAt
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
`;
|
|
738
|
+
var CREATE_LINKED_WORKFLOW = `
|
|
739
|
+
mutation BigConsoleMcpCreateLinkedWorkflow($input: CreateWorkflowInput!) {
|
|
740
|
+
createWorkflow(input: $input) {
|
|
741
|
+
id
|
|
742
|
+
name
|
|
743
|
+
key
|
|
744
|
+
status
|
|
745
|
+
version
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
`;
|
|
749
|
+
var UPDATE_LINKED_WORKFLOW = `
|
|
750
|
+
mutation BigConsoleMcpUpdateLinkedWorkflow($id: ID!, $input: UpdateWorkflowInput!, $version: Int!) {
|
|
751
|
+
updateWorkflow(id: $id, input: $input, version: $version) {
|
|
752
|
+
id
|
|
753
|
+
name
|
|
754
|
+
status
|
|
755
|
+
version
|
|
756
|
+
updatedAt
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
`;
|
|
760
|
+
var EXECUTE_LINKED_WORKFLOW = `
|
|
761
|
+
mutation BigConsoleMcpExecuteLinkedWorkflow($id: ID!, $triggerData: JSON) {
|
|
762
|
+
executeWorkflow(id: $id, triggerData: $triggerData) {
|
|
763
|
+
id
|
|
764
|
+
name
|
|
765
|
+
status
|
|
766
|
+
lastExecutedAt
|
|
767
|
+
lastExecutionId
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
`;
|
|
771
|
+
var LIST_PROMPT_GENERATIONS = `
|
|
772
|
+
query BigConsoleMcpListPromptGenerations($status: PromptGenerationStatus, $first: Int, $after: String) {
|
|
773
|
+
listPromptGenerations(status: $status, first: $first, after: $after) {
|
|
774
|
+
edges {
|
|
775
|
+
node {
|
|
776
|
+
id
|
|
777
|
+
prompt
|
|
778
|
+
status
|
|
779
|
+
dashboardId
|
|
780
|
+
errorMessage
|
|
781
|
+
createdAt
|
|
782
|
+
completedAt
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
totalCount
|
|
786
|
+
pageInfo {
|
|
787
|
+
hasNextPage
|
|
788
|
+
endCursor
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
`;
|
|
793
|
+
var CANCEL_PROMPT_GENERATION = `
|
|
794
|
+
mutation BigConsoleMcpCancelPromptGeneration($generationId: ID!) {
|
|
795
|
+
cancelPromptGeneration(generationId: $generationId) {
|
|
796
|
+
id
|
|
797
|
+
status
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
`;
|
|
801
|
+
var GET_PROMPT_SUGGESTIONS = `
|
|
802
|
+
query BigConsoleMcpGetPromptSuggestions($category: String, $search: String, $limit: Int) {
|
|
803
|
+
getPromptSuggestions(category: $category, search: $search, limit: $limit) {
|
|
804
|
+
id
|
|
805
|
+
title
|
|
806
|
+
prompt
|
|
807
|
+
category
|
|
808
|
+
exampleDescription
|
|
809
|
+
tags
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
`;
|
|
813
|
+
var PREVIEW_PROMPT_ANALYSIS = `
|
|
814
|
+
query BigConsoleMcpPreviewPromptAnalysis($prompt: String!) {
|
|
815
|
+
previewPromptAnalysis(prompt: $prompt) {
|
|
816
|
+
detectedIntent
|
|
817
|
+
detectedMetrics
|
|
818
|
+
dataRequirements
|
|
819
|
+
suggestedCategory
|
|
820
|
+
suggestedWidgetTypes
|
|
821
|
+
suggestedRefinements
|
|
822
|
+
estimatedWidgetCount
|
|
823
|
+
confidence
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
`;
|
|
369
827
|
var WORKSPACE_NOTE = "Operates on the workspace selected via auth_select_workspace \u2014 this tool takes no workspace or token argument. Authorization is enforced at the gateway from the authenticated session.";
|
|
370
828
|
var WIDGET_TYPES = [
|
|
371
829
|
"LINE_CHART",
|
|
@@ -446,6 +904,58 @@ var VersionInt = zod.z.number().int().describe(
|
|
|
446
904
|
var VERSION_OMITTED_MESSAGE = "version is required for optimistic locking \u2014 read the current version from a get/list call first and send it back unchanged. A stale version is rejected by the backend, so re-read and retry rather than guessing or incrementing.";
|
|
447
905
|
var PageSize = zod.z.number().int().min(1).max(100).default(20).describe("Page size (max 100)");
|
|
448
906
|
var PageCursor = zod.z.string().optional().describe("Pagination cursor from pageInfo.endCursor");
|
|
907
|
+
var DashboardLayoutEnum = zod.z.enum(["FLEX", "GRID", "TABS"]).describe("Dashboard layout");
|
|
908
|
+
var PipelineStatusEnum = zod.z.enum(["active", "draft", "error", "inactive"]).describe("Pipeline status");
|
|
909
|
+
var WorkflowStatusEnum = zod.z.enum(["active", "archived", "draft", "error", "paused"]).describe("Workflow status");
|
|
910
|
+
var PromptGenerationStatusEnum = zod.z.enum(["PENDING", "PROCESSING", "GENERATING", "COMPLETED", "FAILED", "CANCELLED"]).describe("Generation status");
|
|
911
|
+
|
|
912
|
+
// src/modules/bigconsole/tools/call.ts
|
|
913
|
+
var READ_ONLY = {
|
|
914
|
+
readOnlyHint: true,
|
|
915
|
+
destructiveHint: false,
|
|
916
|
+
idempotentHint: true
|
|
917
|
+
};
|
|
918
|
+
var WRITE = { readOnlyHint: false, destructiveHint: false };
|
|
919
|
+
var WRITE_EXTERNAL = {
|
|
920
|
+
readOnlyHint: false,
|
|
921
|
+
destructiveHint: false,
|
|
922
|
+
openWorldHint: true
|
|
923
|
+
};
|
|
924
|
+
function describeTool(text) {
|
|
925
|
+
return `${text} ${WORKSPACE_NOTE}`;
|
|
926
|
+
}
|
|
927
|
+
function isClientErrorShape(error) {
|
|
928
|
+
return typeof error === "object" && error !== null && "response" in error && "request" in error;
|
|
929
|
+
}
|
|
930
|
+
function safeErrorMessage(error) {
|
|
931
|
+
if (isClientErrorShape(error)) {
|
|
932
|
+
const errors = error.response?.errors;
|
|
933
|
+
if (Array.isArray(errors) && errors.length > 0) {
|
|
934
|
+
const joined = errors.map((e) => e?.message).filter((m) => typeof m === "string" && m.length > 0).join("; ");
|
|
935
|
+
if (joined) return joined;
|
|
936
|
+
}
|
|
937
|
+
const status = error.response?.status;
|
|
938
|
+
return status === void 0 ? "GraphQL request failed" : `GraphQL error (status ${status})`;
|
|
939
|
+
}
|
|
940
|
+
return error instanceof Error ? error.message : String(error);
|
|
941
|
+
}
|
|
942
|
+
function definedInput(obj) {
|
|
943
|
+
const out = {};
|
|
944
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
945
|
+
if (value !== void 0) out[key] = value;
|
|
946
|
+
}
|
|
947
|
+
return out;
|
|
948
|
+
}
|
|
949
|
+
async function gqlCall(ctx, label, root, document, variables) {
|
|
950
|
+
try {
|
|
951
|
+
const data = await ctx.gql.workspace.request(document, variables);
|
|
952
|
+
return jsonResult(data[root]);
|
|
953
|
+
} catch (error) {
|
|
954
|
+
const message = safeErrorMessage(error);
|
|
955
|
+
ctx.logger.error(`bigconsole ${label} failed`, { error: message });
|
|
956
|
+
return errorResult(`Failed (${label}): ${message}`);
|
|
957
|
+
}
|
|
958
|
+
}
|
|
449
959
|
|
|
450
960
|
// src/modules/bigconsole/tools/dashboards.ts
|
|
451
961
|
function registerDashboardTools(server, ctx, track) {
|
|
@@ -647,6 +1157,69 @@ function registerDashboardTools(server, ctx, track) {
|
|
|
647
1157
|
}
|
|
648
1158
|
}
|
|
649
1159
|
);
|
|
1160
|
+
server.registerTool(
|
|
1161
|
+
track(mcpToolName(ctx.productName, "dashboard_update")),
|
|
1162
|
+
{
|
|
1163
|
+
title: "Update Dashboard",
|
|
1164
|
+
description: describeTool(
|
|
1165
|
+
"Update a dashboard's name, description, category, visibility, layout or tags. Only the fields you pass change. It cannot archive, restore or publish the dashboard."
|
|
1166
|
+
),
|
|
1167
|
+
annotations: WRITE,
|
|
1168
|
+
inputSchema: {
|
|
1169
|
+
id: zod.z.string().describe("Dashboard ID"),
|
|
1170
|
+
name: zod.z.string().optional().describe("New dashboard name"),
|
|
1171
|
+
description: zod.z.string().optional().describe("New description"),
|
|
1172
|
+
category: DashboardCategoryEnum.optional(),
|
|
1173
|
+
visibility: DashboardVisibilityEnum.optional(),
|
|
1174
|
+
layout: DashboardLayoutEnum.optional(),
|
|
1175
|
+
tagIds: zod.z.array(zod.z.string()).optional().describe("Replacement tag IDs")
|
|
1176
|
+
}
|
|
1177
|
+
},
|
|
1178
|
+
async (args) => gqlCall(ctx, "dashboard_update", "updateBigConsoleDashboard", UPDATE_DASHBOARD, {
|
|
1179
|
+
input: definedInput(args)
|
|
1180
|
+
})
|
|
1181
|
+
);
|
|
1182
|
+
server.registerTool(
|
|
1183
|
+
track(mcpToolName(ctx.productName, "dashboard_clone")),
|
|
1184
|
+
{
|
|
1185
|
+
title: "Clone Dashboard",
|
|
1186
|
+
description: describeTool(
|
|
1187
|
+
"Copy a dashboard under a new name, optionally with its widgets and comments. The copy is not shared with anyone the original was shared with."
|
|
1188
|
+
),
|
|
1189
|
+
annotations: WRITE,
|
|
1190
|
+
inputSchema: {
|
|
1191
|
+
sourceDashboardId: zod.z.string().describe("Dashboard to copy"),
|
|
1192
|
+
name: zod.z.string().describe("Name of the copy"),
|
|
1193
|
+
includeWidgets: zod.z.boolean().optional().describe("Copy the widgets too"),
|
|
1194
|
+
includeComments: zod.z.boolean().optional().describe("Copy the comments too")
|
|
1195
|
+
}
|
|
1196
|
+
},
|
|
1197
|
+
async (args) => gqlCall(ctx, "dashboard_clone", "cloneDashboard", CLONE_DASHBOARD, {
|
|
1198
|
+
input: definedInput(args)
|
|
1199
|
+
})
|
|
1200
|
+
);
|
|
1201
|
+
server.registerTool(
|
|
1202
|
+
track(mcpToolName(ctx.productName, "dashboards_search")),
|
|
1203
|
+
{
|
|
1204
|
+
title: "Search Dashboards",
|
|
1205
|
+
description: describeTool(
|
|
1206
|
+
"Search dashboards by name and description text, with optional category and visibility filters. Returns a plain list (no totals); page with first and after."
|
|
1207
|
+
),
|
|
1208
|
+
annotations: READ_ONLY,
|
|
1209
|
+
inputSchema: {
|
|
1210
|
+
query: zod.z.string().describe("Search text"),
|
|
1211
|
+
category: DashboardCategoryEnum.optional(),
|
|
1212
|
+
visibility: DashboardVisibilityEnum.optional(),
|
|
1213
|
+
first: PageSize,
|
|
1214
|
+
after: PageCursor
|
|
1215
|
+
}
|
|
1216
|
+
},
|
|
1217
|
+
async ({ query, category, visibility, first, after }) => gqlCall(ctx, "dashboards_search", "searchDashboards", SEARCH_DASHBOARDS, {
|
|
1218
|
+
query,
|
|
1219
|
+
first: first ?? 20,
|
|
1220
|
+
...definedInput({ category, visibility, after })
|
|
1221
|
+
})
|
|
1222
|
+
);
|
|
650
1223
|
}
|
|
651
1224
|
function registerDataSinkTools(server, ctx, track) {
|
|
652
1225
|
server.registerTool(
|
|
@@ -785,6 +1358,48 @@ function registerDataSinkTools(server, ctx, track) {
|
|
|
785
1358
|
}
|
|
786
1359
|
}
|
|
787
1360
|
);
|
|
1361
|
+
server.registerTool(
|
|
1362
|
+
track(mcpToolName(ctx.productName, "datasink_refresh")),
|
|
1363
|
+
{
|
|
1364
|
+
title: "Refresh Data Sink",
|
|
1365
|
+
description: describeTool(
|
|
1366
|
+
"Pull fresh data into a sink from its source now. Give id or key. Returns the sink status and when it was last refreshed, not the rows."
|
|
1367
|
+
),
|
|
1368
|
+
annotations: WRITE,
|
|
1369
|
+
inputSchema: {
|
|
1370
|
+
id: zod.z.string().optional().describe("Data sink ID"),
|
|
1371
|
+
key: zod.z.string().optional().describe("Data sink key \u2014 alternative to id"),
|
|
1372
|
+
forceRefresh: zod.z.boolean().optional().describe("Ignore the cache TTL"),
|
|
1373
|
+
queryParams: zod.z.record(zod.z.string(), zod.z.unknown()).optional().describe("Source query params")
|
|
1374
|
+
}
|
|
1375
|
+
},
|
|
1376
|
+
async (args) => {
|
|
1377
|
+
if (args.id === void 0 === (args.key === void 0)) {
|
|
1378
|
+
return errorResult("Provide exactly one of id or key.");
|
|
1379
|
+
}
|
|
1380
|
+
return gqlCall(ctx, "datasink_refresh", "refreshDataSink", REFRESH_DATA_SINK, {
|
|
1381
|
+
input: definedInput(args)
|
|
1382
|
+
});
|
|
1383
|
+
}
|
|
1384
|
+
);
|
|
1385
|
+
server.registerTool(
|
|
1386
|
+
track(mcpToolName(ctx.productName, "datasink_invalidate_cache")),
|
|
1387
|
+
{
|
|
1388
|
+
title: "Invalidate Data Sink Cache",
|
|
1389
|
+
description: describeTool(
|
|
1390
|
+
"Drop the cached data of one sink (id) or, with no id, of every sink in the workspace. The next read fetches from the source again. Stored data is not deleted."
|
|
1391
|
+
),
|
|
1392
|
+
annotations: WRITE,
|
|
1393
|
+
inputSchema: { id: zod.z.string().optional().describe("Data sink ID; omit for all sinks") }
|
|
1394
|
+
},
|
|
1395
|
+
async ({ id }) => gqlCall(
|
|
1396
|
+
ctx,
|
|
1397
|
+
"datasink_invalidate_cache",
|
|
1398
|
+
"invalidateDataSinkCache",
|
|
1399
|
+
INVALIDATE_DATA_SINK_CACHE,
|
|
1400
|
+
definedInput({ id })
|
|
1401
|
+
)
|
|
1402
|
+
);
|
|
788
1403
|
}
|
|
789
1404
|
var TERMINAL_STATUSES = ["COMPLETED", "FAILED", "CANCELLED"];
|
|
790
1405
|
var TERMINAL_SET = new Set(TERMINAL_STATUSES);
|
|
@@ -927,6 +1542,144 @@ function registerGenerateTools(server, ctx, track) {
|
|
|
927
1542
|
}
|
|
928
1543
|
);
|
|
929
1544
|
}
|
|
1545
|
+
function registerLinkedWorkflowTools(server, ctx, track) {
|
|
1546
|
+
server.registerTool(
|
|
1547
|
+
track(mcpToolName(ctx.productName, "linked_workflow_get")),
|
|
1548
|
+
{
|
|
1549
|
+
title: "Get Linked Workflow",
|
|
1550
|
+
description: describeTool(
|
|
1551
|
+
"One BigConsole workflow by ID, with its current version. These are the workflows registered in BigConsole to feed data sinks, not FluidGrids workflow definitions. The webhook URL and config are not returned."
|
|
1552
|
+
),
|
|
1553
|
+
annotations: READ_ONLY,
|
|
1554
|
+
inputSchema: { id: zod.z.string().describe("Workflow ID") }
|
|
1555
|
+
},
|
|
1556
|
+
async ({ id }) => gqlCall(ctx, "linked_workflow_get", "workflow", GET_LINKED_WORKFLOW, { id })
|
|
1557
|
+
);
|
|
1558
|
+
server.registerTool(
|
|
1559
|
+
track(mcpToolName(ctx.productName, "linked_workflows_list")),
|
|
1560
|
+
{
|
|
1561
|
+
title: "List Linked Workflows",
|
|
1562
|
+
description: describeTool(
|
|
1563
|
+
"The BigConsole workflows in the workspace, filtered by key, status or search text. The list is not paged."
|
|
1564
|
+
),
|
|
1565
|
+
annotations: READ_ONLY,
|
|
1566
|
+
inputSchema: {
|
|
1567
|
+
key: zod.z.string().optional().describe("Exact workflow key"),
|
|
1568
|
+
status: WorkflowStatusEnum.optional(),
|
|
1569
|
+
searchQuery: zod.z.string().optional().describe("Search text")
|
|
1570
|
+
}
|
|
1571
|
+
},
|
|
1572
|
+
async ({ key, status, searchQuery }) => {
|
|
1573
|
+
const filter = definedInput({ key, status, searchQuery });
|
|
1574
|
+
return gqlCall(
|
|
1575
|
+
ctx,
|
|
1576
|
+
"linked_workflows_list",
|
|
1577
|
+
"workflows",
|
|
1578
|
+
LIST_LINKED_WORKFLOWS,
|
|
1579
|
+
Object.keys(filter).length > 0 ? { filter } : {}
|
|
1580
|
+
);
|
|
1581
|
+
}
|
|
1582
|
+
);
|
|
1583
|
+
server.registerTool(
|
|
1584
|
+
track(mcpToolName(ctx.productName, "linked_workflow_get_by_key")),
|
|
1585
|
+
{
|
|
1586
|
+
title: "Get Linked Workflow By Key",
|
|
1587
|
+
description: describeTool("One BigConsole workflow by its unique key."),
|
|
1588
|
+
annotations: READ_ONLY,
|
|
1589
|
+
inputSchema: { key: zod.z.string().describe("Workflow key") }
|
|
1590
|
+
},
|
|
1591
|
+
async ({ key }) => gqlCall(ctx, "linked_workflow_get_by_key", "workflowByKey", GET_LINKED_WORKFLOW_BY_KEY, {
|
|
1592
|
+
key
|
|
1593
|
+
})
|
|
1594
|
+
);
|
|
1595
|
+
server.registerTool(
|
|
1596
|
+
track(mcpToolName(ctx.productName, "linked_workflow_data_sink_links")),
|
|
1597
|
+
{
|
|
1598
|
+
title: "List Linked Workflow Data Sink Links",
|
|
1599
|
+
description: describeTool(
|
|
1600
|
+
"The data sinks a BigConsole workflow feeds, with each link's priority, mapping and whether it is enabled."
|
|
1601
|
+
),
|
|
1602
|
+
annotations: READ_ONLY,
|
|
1603
|
+
inputSchema: { workflowId: zod.z.string().describe("Workflow ID") }
|
|
1604
|
+
},
|
|
1605
|
+
async ({ workflowId }) => gqlCall(
|
|
1606
|
+
ctx,
|
|
1607
|
+
"linked_workflow_data_sink_links",
|
|
1608
|
+
"workflowDataSinkLinks",
|
|
1609
|
+
LIST_LINKED_WORKFLOW_DATA_SINK_LINKS,
|
|
1610
|
+
{ workflowId }
|
|
1611
|
+
)
|
|
1612
|
+
);
|
|
1613
|
+
server.registerTool(
|
|
1614
|
+
track(mcpToolName(ctx.productName, "linked_workflow_create")),
|
|
1615
|
+
{
|
|
1616
|
+
title: "Create Linked Workflow",
|
|
1617
|
+
description: describeTool(
|
|
1618
|
+
"Register a BigConsole workflow. key and name are required. Link it to an external FluidGrids workflow with externalWorkflowId and to data sinks with dataSinkKeys."
|
|
1619
|
+
),
|
|
1620
|
+
annotations: WRITE,
|
|
1621
|
+
inputSchema: {
|
|
1622
|
+
key: zod.z.string().describe("Unique workflow key"),
|
|
1623
|
+
name: zod.z.string().describe("Workflow name"),
|
|
1624
|
+
description: zod.z.string().optional().describe("What the workflow does"),
|
|
1625
|
+
externalWorkflowId: zod.z.string().optional().describe("FluidGrids workflow to link"),
|
|
1626
|
+
dataSinkKeys: zod.z.array(DataSinkKey).optional().describe("Data sinks the workflow feeds"),
|
|
1627
|
+
status: WorkflowStatusEnum.optional(),
|
|
1628
|
+
config: zod.z.record(zod.z.string(), zod.z.unknown()).optional().describe("Workflow settings")
|
|
1629
|
+
}
|
|
1630
|
+
},
|
|
1631
|
+
async (args) => gqlCall(ctx, "linked_workflow_create", "createWorkflow", CREATE_LINKED_WORKFLOW, {
|
|
1632
|
+
input: definedInput(args)
|
|
1633
|
+
})
|
|
1634
|
+
);
|
|
1635
|
+
server.registerTool(
|
|
1636
|
+
track(mcpToolName(ctx.productName, "linked_workflow_update")),
|
|
1637
|
+
{
|
|
1638
|
+
title: "Update Linked Workflow",
|
|
1639
|
+
description: describeTool(
|
|
1640
|
+
"Update a BigConsole workflow with optimistic locking. `version` is REQUIRED \u2014 read it from linked_workflow_get first and send it back unchanged; a stale version is rejected, so re-read and retry."
|
|
1641
|
+
),
|
|
1642
|
+
annotations: WRITE,
|
|
1643
|
+
inputSchema: {
|
|
1644
|
+
id: zod.z.string().describe("Workflow ID"),
|
|
1645
|
+
version: VersionInt.optional(),
|
|
1646
|
+
name: zod.z.string().optional().describe("New name"),
|
|
1647
|
+
description: zod.z.string().optional().describe("New description"),
|
|
1648
|
+
status: WorkflowStatusEnum.optional(),
|
|
1649
|
+
config: zod.z.record(zod.z.string(), zod.z.unknown()).optional().describe("Replacement settings")
|
|
1650
|
+
}
|
|
1651
|
+
},
|
|
1652
|
+
async ({ id, version, ...fields }) => {
|
|
1653
|
+
if (version === void 0) return errorResult(VERSION_OMITTED_MESSAGE);
|
|
1654
|
+
return gqlCall(ctx, "linked_workflow_update", "updateWorkflow", UPDATE_LINKED_WORKFLOW, {
|
|
1655
|
+
id,
|
|
1656
|
+
version,
|
|
1657
|
+
input: definedInput(fields)
|
|
1658
|
+
});
|
|
1659
|
+
}
|
|
1660
|
+
);
|
|
1661
|
+
server.registerTool(
|
|
1662
|
+
track(mcpToolName(ctx.productName, "linked_workflow_execute")),
|
|
1663
|
+
{
|
|
1664
|
+
title: "Execute Linked Workflow",
|
|
1665
|
+
description: describeTool(
|
|
1666
|
+
"Run a BigConsole workflow now, passing optional trigger data. It starts the linked external workflow, which can change data in the sinks it feeds and reach other systems, so confirm with the user before running one you did not create."
|
|
1667
|
+
),
|
|
1668
|
+
annotations: WRITE_EXTERNAL,
|
|
1669
|
+
inputSchema: {
|
|
1670
|
+
id: zod.z.string().describe("Workflow ID"),
|
|
1671
|
+
triggerData: zod.z.unknown().optional().describe("Payload passed to the workflow")
|
|
1672
|
+
}
|
|
1673
|
+
},
|
|
1674
|
+
async (args) => gqlCall(
|
|
1675
|
+
ctx,
|
|
1676
|
+
"linked_workflow_execute",
|
|
1677
|
+
"executeWorkflow",
|
|
1678
|
+
EXECUTE_LINKED_WORKFLOW,
|
|
1679
|
+
definedInput(args)
|
|
1680
|
+
)
|
|
1681
|
+
);
|
|
1682
|
+
}
|
|
930
1683
|
function registerParserTools(server, ctx, track) {
|
|
931
1684
|
server.registerTool(
|
|
932
1685
|
track(mcpToolName(ctx.productName, "parsers_list")),
|
|
@@ -1094,6 +1847,272 @@ function registerParserTools(server, ctx, track) {
|
|
|
1094
1847
|
}
|
|
1095
1848
|
}
|
|
1096
1849
|
);
|
|
1850
|
+
server.registerTool(
|
|
1851
|
+
track(mcpToolName(ctx.productName, "parser_get")),
|
|
1852
|
+
{
|
|
1853
|
+
title: "Get Parser",
|
|
1854
|
+
description: describeTool(
|
|
1855
|
+
"One parser with its expression and current version. Read it before parser_update: the update needs the version back unchanged."
|
|
1856
|
+
),
|
|
1857
|
+
annotations: READ_ONLY,
|
|
1858
|
+
inputSchema: { id: zod.z.string().describe("Parser ID") }
|
|
1859
|
+
},
|
|
1860
|
+
async ({ id }) => gqlCall(ctx, "parser_get", "parser", GET_PARSER, { id })
|
|
1861
|
+
);
|
|
1862
|
+
server.registerTool(
|
|
1863
|
+
track(mcpToolName(ctx.productName, "parser_execute")),
|
|
1864
|
+
{
|
|
1865
|
+
title: "Execute Parser",
|
|
1866
|
+
description: describeTool(
|
|
1867
|
+
"Run a stored parser against its input sink and write the result under its output key. Returns success, error and timing, not the output rows. Use parser_test_expression first to try an expression without storing anything."
|
|
1868
|
+
),
|
|
1869
|
+
annotations: WRITE,
|
|
1870
|
+
inputSchema: { id: zod.z.string().describe("Parser ID") }
|
|
1871
|
+
},
|
|
1872
|
+
async ({ id }) => gqlCall(ctx, "parser_execute", "executeParser", EXECUTE_PARSER, { id })
|
|
1873
|
+
);
|
|
1874
|
+
}
|
|
1875
|
+
var StageErrorHandling = zod.z.enum(["fail", "fallback", "skip"]).describe("What a failing stage does: fail the run, use fallbackValue, or skip the stage");
|
|
1876
|
+
var StageFields = {
|
|
1877
|
+
parserName: zod.z.string().optional().describe("Display name of the parser"),
|
|
1878
|
+
parserType: ParserTypeEnum.optional(),
|
|
1879
|
+
expression: zod.z.string().optional().describe("Expression override for this stage"),
|
|
1880
|
+
enabled: zod.z.boolean().optional().describe("Whether the stage runs (default true)"),
|
|
1881
|
+
onError: StageErrorHandling.optional(),
|
|
1882
|
+
fallbackValue: zod.z.unknown().optional().describe('Value used when onError is "fallback"'),
|
|
1883
|
+
description: zod.z.string().optional().describe("What the stage does")
|
|
1884
|
+
};
|
|
1885
|
+
var CreateStage = zod.z.object({
|
|
1886
|
+
parserId: zod.z.string().describe("Stored parser this stage runs"),
|
|
1887
|
+
inputKey: zod.z.string().describe("Data key the stage reads"),
|
|
1888
|
+
outputKey: zod.z.string().describe("Data key the stage writes"),
|
|
1889
|
+
...StageFields
|
|
1890
|
+
});
|
|
1891
|
+
var UpdateStage = zod.z.object({
|
|
1892
|
+
id: zod.z.string().optional().describe("Existing stage ID; omit to add a stage"),
|
|
1893
|
+
parserId: zod.z.string().optional().describe("Stored parser this stage runs"),
|
|
1894
|
+
inputKey: zod.z.string().optional().describe("Data key the stage reads"),
|
|
1895
|
+
outputKey: zod.z.string().optional().describe("Data key the stage writes"),
|
|
1896
|
+
...StageFields
|
|
1897
|
+
});
|
|
1898
|
+
function registerPipelineTools(server, ctx, track) {
|
|
1899
|
+
server.registerTool(
|
|
1900
|
+
track(mcpToolName(ctx.productName, "pipeline_get")),
|
|
1901
|
+
{
|
|
1902
|
+
title: "Get Pipeline",
|
|
1903
|
+
description: describeTool(
|
|
1904
|
+
"One pipeline with its ordered stages and current version. Read it before pipeline_update: the update needs the version back unchanged."
|
|
1905
|
+
),
|
|
1906
|
+
annotations: READ_ONLY,
|
|
1907
|
+
inputSchema: { id: zod.z.string().describe("Pipeline ID") }
|
|
1908
|
+
},
|
|
1909
|
+
async ({ id }) => gqlCall(ctx, "pipeline_get", "pipeline", GET_PIPELINE, { id })
|
|
1910
|
+
);
|
|
1911
|
+
server.registerTool(
|
|
1912
|
+
track(mcpToolName(ctx.productName, "pipelines_list")),
|
|
1913
|
+
{
|
|
1914
|
+
title: "List Pipelines",
|
|
1915
|
+
description: describeTool(
|
|
1916
|
+
"Pipelines in the workspace, metadata only (no stages; use pipeline_get). Filter by dashboard (consoleId) or status."
|
|
1917
|
+
),
|
|
1918
|
+
annotations: READ_ONLY,
|
|
1919
|
+
inputSchema: {
|
|
1920
|
+
consoleId: zod.z.string().optional().describe("Only pipelines of this dashboard"),
|
|
1921
|
+
status: PipelineStatusEnum.optional(),
|
|
1922
|
+
first: PageSize,
|
|
1923
|
+
after: PageCursor
|
|
1924
|
+
}
|
|
1925
|
+
},
|
|
1926
|
+
async ({ consoleId, status, first, after }) => {
|
|
1927
|
+
const filter = definedInput({ consoleId, status });
|
|
1928
|
+
return gqlCall(ctx, "pipelines_list", "listPipelines", LIST_PIPELINES, {
|
|
1929
|
+
first: first ?? 20,
|
|
1930
|
+
...definedInput({ after }),
|
|
1931
|
+
...Object.keys(filter).length > 0 ? { filter } : {}
|
|
1932
|
+
});
|
|
1933
|
+
}
|
|
1934
|
+
);
|
|
1935
|
+
server.registerTool(
|
|
1936
|
+
track(mcpToolName(ctx.productName, "pipeline_create")),
|
|
1937
|
+
{
|
|
1938
|
+
title: "Create Pipeline",
|
|
1939
|
+
description: describeTool(
|
|
1940
|
+
"Create a pipeline on a dashboard (consoleId) from ordered stages. Each stage names a stored parser and the data keys it reads and writes. Try it with pipeline_test before running it for real."
|
|
1941
|
+
),
|
|
1942
|
+
annotations: WRITE,
|
|
1943
|
+
inputSchema: {
|
|
1944
|
+
consoleId: zod.z.string().describe("Dashboard ID the pipeline belongs to"),
|
|
1945
|
+
name: zod.z.string().describe("Pipeline name"),
|
|
1946
|
+
description: zod.z.string().optional().describe("What the pipeline does"),
|
|
1947
|
+
status: PipelineStatusEnum.optional(),
|
|
1948
|
+
stages: zod.z.array(CreateStage).optional().describe("Stages, in run order")
|
|
1949
|
+
}
|
|
1950
|
+
},
|
|
1951
|
+
async (args) => gqlCall(ctx, "pipeline_create", "createPipeline", CREATE_PIPELINE, {
|
|
1952
|
+
input: definedInput(args)
|
|
1953
|
+
})
|
|
1954
|
+
);
|
|
1955
|
+
server.registerTool(
|
|
1956
|
+
track(mcpToolName(ctx.productName, "pipeline_update")),
|
|
1957
|
+
{
|
|
1958
|
+
title: "Update Pipeline",
|
|
1959
|
+
description: describeTool(
|
|
1960
|
+
"Update a pipeline with optimistic locking. `version` is REQUIRED \u2014 read it from pipeline_get first and send it back unchanged; a stale version is rejected, so re-read and retry. A stages list you pass replaces the stored stages."
|
|
1961
|
+
),
|
|
1962
|
+
annotations: WRITE,
|
|
1963
|
+
inputSchema: {
|
|
1964
|
+
id: zod.z.string().describe("Pipeline ID"),
|
|
1965
|
+
version: VersionInt.optional(),
|
|
1966
|
+
name: zod.z.string().optional().describe("New name"),
|
|
1967
|
+
description: zod.z.string().optional().describe("New description"),
|
|
1968
|
+
status: PipelineStatusEnum.optional(),
|
|
1969
|
+
stages: zod.z.array(UpdateStage).optional().describe("Replacement stages, in run order")
|
|
1970
|
+
}
|
|
1971
|
+
},
|
|
1972
|
+
async ({ id, version, ...fields }) => {
|
|
1973
|
+
if (version === void 0) return errorResult(VERSION_OMITTED_MESSAGE);
|
|
1974
|
+
return gqlCall(ctx, "pipeline_update", "updatePipeline", UPDATE_PIPELINE, {
|
|
1975
|
+
id,
|
|
1976
|
+
version,
|
|
1977
|
+
input: definedInput(fields)
|
|
1978
|
+
});
|
|
1979
|
+
}
|
|
1980
|
+
);
|
|
1981
|
+
server.registerTool(
|
|
1982
|
+
track(mcpToolName(ctx.productName, "pipeline_execute")),
|
|
1983
|
+
{
|
|
1984
|
+
title: "Execute Pipeline",
|
|
1985
|
+
description: describeTool(
|
|
1986
|
+
"Run a stored pipeline now. Its stages write their output keys, replacing what those keys held, so try the pipeline with pipeline_test first. Returns the execution record; follow it with pipeline_executions_list."
|
|
1987
|
+
),
|
|
1988
|
+
annotations: WRITE,
|
|
1989
|
+
inputSchema: {
|
|
1990
|
+
pipelineId: zod.z.string().describe("Pipeline ID"),
|
|
1991
|
+
inputData: zod.z.unknown().optional().describe("Input for the first stage")
|
|
1992
|
+
}
|
|
1993
|
+
},
|
|
1994
|
+
async (args) => gqlCall(ctx, "pipeline_execute", "executePipeline", EXECUTE_PIPELINE, {
|
|
1995
|
+
input: definedInput(args)
|
|
1996
|
+
})
|
|
1997
|
+
);
|
|
1998
|
+
server.registerTool(
|
|
1999
|
+
track(mcpToolName(ctx.productName, "pipeline_test")),
|
|
2000
|
+
{
|
|
2001
|
+
title: "Test Pipeline",
|
|
2002
|
+
description: describeTool(
|
|
2003
|
+
"Run a pipeline in test mode on the inputData you give and return the execution record (status, timing, error). Use it to try a pipeline before pipeline_execute."
|
|
2004
|
+
),
|
|
2005
|
+
annotations: WRITE,
|
|
2006
|
+
inputSchema: {
|
|
2007
|
+
pipelineId: zod.z.string().describe("Pipeline ID"),
|
|
2008
|
+
inputData: zod.z.unknown().describe("Sample input for the first stage")
|
|
2009
|
+
}
|
|
2010
|
+
},
|
|
2011
|
+
async (args) => gqlCall(ctx, "pipeline_test", "testPipeline", TEST_PIPELINE, {
|
|
2012
|
+
input: definedInput(args)
|
|
2013
|
+
})
|
|
2014
|
+
);
|
|
2015
|
+
server.registerTool(
|
|
2016
|
+
track(mcpToolName(ctx.productName, "pipeline_executions_list")),
|
|
2017
|
+
{
|
|
2018
|
+
title: "List Pipeline Executions",
|
|
2019
|
+
description: describeTool(
|
|
2020
|
+
"The past runs of a pipeline, newest first: status, timing and any error."
|
|
2021
|
+
),
|
|
2022
|
+
annotations: READ_ONLY,
|
|
2023
|
+
inputSchema: {
|
|
2024
|
+
pipelineId: zod.z.string().describe("Pipeline ID"),
|
|
2025
|
+
first: PageSize,
|
|
2026
|
+
after: PageCursor
|
|
2027
|
+
}
|
|
2028
|
+
},
|
|
2029
|
+
async ({ pipelineId, first, after }) => gqlCall(ctx, "pipeline_executions_list", "listPipelineExecutions", LIST_PIPELINE_EXECUTIONS, {
|
|
2030
|
+
pipelineId,
|
|
2031
|
+
first: first ?? 20,
|
|
2032
|
+
...definedInput({ after })
|
|
2033
|
+
})
|
|
2034
|
+
);
|
|
2035
|
+
}
|
|
2036
|
+
function registerPromptTools(server, ctx, track) {
|
|
2037
|
+
server.registerTool(
|
|
2038
|
+
track(mcpToolName(ctx.productName, "prompt_generations_list")),
|
|
2039
|
+
{
|
|
2040
|
+
title: "List Prompt Generations",
|
|
2041
|
+
description: describeTool(
|
|
2042
|
+
"Earlier AI dashboard generations, newest first, optionally by status: prompt, status, resulting dashboard and any error."
|
|
2043
|
+
),
|
|
2044
|
+
annotations: READ_ONLY,
|
|
2045
|
+
inputSchema: {
|
|
2046
|
+
status: PromptGenerationStatusEnum.optional(),
|
|
2047
|
+
first: PageSize,
|
|
2048
|
+
after: PageCursor
|
|
2049
|
+
}
|
|
2050
|
+
},
|
|
2051
|
+
async ({ status, first, after }) => gqlCall(ctx, "prompt_generations_list", "listPromptGenerations", LIST_PROMPT_GENERATIONS, {
|
|
2052
|
+
first: first ?? 20,
|
|
2053
|
+
...definedInput({ status, after })
|
|
2054
|
+
})
|
|
2055
|
+
);
|
|
2056
|
+
server.registerTool(
|
|
2057
|
+
track(mcpToolName(ctx.productName, "prompt_generation_get")),
|
|
2058
|
+
{
|
|
2059
|
+
title: "Get Prompt Generation",
|
|
2060
|
+
description: describeTool(
|
|
2061
|
+
"One AI dashboard generation: status, error, the digest of the generated spec and the dashboard it produced."
|
|
2062
|
+
),
|
|
2063
|
+
annotations: READ_ONLY,
|
|
2064
|
+
inputSchema: { id: zod.z.string().describe("Generation ID") }
|
|
2065
|
+
},
|
|
2066
|
+
async ({ id }) => gqlCall(ctx, "prompt_generation_get", "getPromptGeneration", GET_PROMPT_GENERATION, { id })
|
|
2067
|
+
);
|
|
2068
|
+
server.registerTool(
|
|
2069
|
+
track(mcpToolName(ctx.productName, "prompt_generation_cancel")),
|
|
2070
|
+
{
|
|
2071
|
+
title: "Cancel Prompt Generation",
|
|
2072
|
+
description: describeTool(
|
|
2073
|
+
"Stop an AI dashboard generation that is still pending or running. A finished generation cannot be cancelled."
|
|
2074
|
+
),
|
|
2075
|
+
annotations: WRITE,
|
|
2076
|
+
inputSchema: { generationId: zod.z.string().describe("Generation ID") }
|
|
2077
|
+
},
|
|
2078
|
+
async ({ generationId }) => gqlCall(ctx, "prompt_generation_cancel", "cancelPromptGeneration", CANCEL_PROMPT_GENERATION, {
|
|
2079
|
+
generationId
|
|
2080
|
+
})
|
|
2081
|
+
);
|
|
2082
|
+
server.registerTool(
|
|
2083
|
+
track(mcpToolName(ctx.productName, "prompt_suggestions")),
|
|
2084
|
+
{
|
|
2085
|
+
title: "Get Prompt Suggestions",
|
|
2086
|
+
description: describeTool(
|
|
2087
|
+
"Example prompts for dashboard generation, filtered by category or search text."
|
|
2088
|
+
),
|
|
2089
|
+
annotations: READ_ONLY,
|
|
2090
|
+
inputSchema: {
|
|
2091
|
+
category: zod.z.string().optional().describe("Prompt category"),
|
|
2092
|
+
search: zod.z.string().optional().describe("Search text"),
|
|
2093
|
+
limit: zod.z.number().int().min(1).max(50).default(10).describe("Maximum suggestions")
|
|
2094
|
+
}
|
|
2095
|
+
},
|
|
2096
|
+
async ({ category, search, limit }) => gqlCall(
|
|
2097
|
+
ctx,
|
|
2098
|
+
"prompt_suggestions",
|
|
2099
|
+
"getPromptSuggestions",
|
|
2100
|
+
GET_PROMPT_SUGGESTIONS,
|
|
2101
|
+
definedInput({ category, search, limit: limit ?? 10 })
|
|
2102
|
+
)
|
|
2103
|
+
);
|
|
2104
|
+
server.registerTool(
|
|
2105
|
+
track(mcpToolName(ctx.productName, "prompt_analyze")),
|
|
2106
|
+
{
|
|
2107
|
+
title: "Analyze Prompt",
|
|
2108
|
+
description: describeTool(
|
|
2109
|
+
"Preview how BigConsole would read a prompt \u2014 intent, metrics, data needs, suggested widgets \u2014 without generating anything or using a generation."
|
|
2110
|
+
),
|
|
2111
|
+
annotations: READ_ONLY,
|
|
2112
|
+
inputSchema: { prompt: zod.z.string().describe("The dashboard prompt, in plain English") }
|
|
2113
|
+
},
|
|
2114
|
+
async ({ prompt }) => gqlCall(ctx, "prompt_analyze", "previewPromptAnalysis", PREVIEW_PROMPT_ANALYSIS, { prompt })
|
|
2115
|
+
);
|
|
1097
2116
|
}
|
|
1098
2117
|
function registerWidgetTools(server, ctx, track) {
|
|
1099
2118
|
server.registerTool(
|
|
@@ -1139,6 +2158,119 @@ function registerWidgetTools(server, ctx, track) {
|
|
|
1139
2158
|
}
|
|
1140
2159
|
}
|
|
1141
2160
|
);
|
|
2161
|
+
server.registerTool(
|
|
2162
|
+
track(mcpToolName(ctx.productName, "widget_get")),
|
|
2163
|
+
{
|
|
2164
|
+
title: "Get Widget",
|
|
2165
|
+
description: describeTool(
|
|
2166
|
+
"One widget with its full config. This is the only read that returns a widget config; read it before widget_update so you change the config rather than replace it blind."
|
|
2167
|
+
),
|
|
2168
|
+
annotations: READ_ONLY,
|
|
2169
|
+
inputSchema: { id: zod.z.string().describe("Widget ID") }
|
|
2170
|
+
},
|
|
2171
|
+
async ({ id }) => gqlCall(ctx, "widget_get", "getWidget", GET_WIDGET, { id })
|
|
2172
|
+
);
|
|
2173
|
+
server.registerTool(
|
|
2174
|
+
track(mcpToolName(ctx.productName, "widgets_list")),
|
|
2175
|
+
{
|
|
2176
|
+
title: "List Widgets",
|
|
2177
|
+
description: describeTool(
|
|
2178
|
+
"The widgets of one dashboard \u2014 id, page, type, title, renderer, position and bindings, never the config (use widget_get for that). Optionally filter by widget type."
|
|
2179
|
+
),
|
|
2180
|
+
annotations: READ_ONLY,
|
|
2181
|
+
inputSchema: {
|
|
2182
|
+
dashboardId: zod.z.string().describe("Dashboard ID"),
|
|
2183
|
+
type: WidgetTypeEnum.optional()
|
|
2184
|
+
}
|
|
2185
|
+
},
|
|
2186
|
+
async ({ dashboardId, type }) => gqlCall(
|
|
2187
|
+
ctx,
|
|
2188
|
+
"widgets_list",
|
|
2189
|
+
"listWidgetsByDashboard",
|
|
2190
|
+
LIST_WIDGETS_BY_DASHBOARD,
|
|
2191
|
+
definedInput({ dashboardId, type })
|
|
2192
|
+
)
|
|
2193
|
+
);
|
|
2194
|
+
server.registerTool(
|
|
2195
|
+
track(mcpToolName(ctx.productName, "widget_update")),
|
|
2196
|
+
{
|
|
2197
|
+
title: "Update Widget",
|
|
2198
|
+
description: describeTool(
|
|
2199
|
+
"Change a widget's title, config, position or data binding. Only the fields you pass change. A config you pass replaces the stored one, so start from widget_get. The same config rules as widget_create apply."
|
|
2200
|
+
),
|
|
2201
|
+
annotations: WRITE,
|
|
2202
|
+
inputSchema: {
|
|
2203
|
+
id: zod.z.string().describe("Widget ID"),
|
|
2204
|
+
title: zod.z.string().optional().describe("New title"),
|
|
2205
|
+
config: WidgetConfig.optional(),
|
|
2206
|
+
position: WidgetPosition.optional(),
|
|
2207
|
+
parserId: zod.z.string().optional().describe("Parser whose output the widget reads"),
|
|
2208
|
+
dataSinkId: zod.z.string().optional().describe("Data sink the widget reads"),
|
|
2209
|
+
refreshInterval: zod.z.number().int().min(0).optional().describe("Auto-refresh seconds")
|
|
2210
|
+
}
|
|
2211
|
+
},
|
|
2212
|
+
async (args) => gqlCall(ctx, "widget_update", "updateBigConsoleWidget", UPDATE_WIDGET, {
|
|
2213
|
+
input: definedInput(args)
|
|
2214
|
+
})
|
|
2215
|
+
);
|
|
2216
|
+
server.registerTool(
|
|
2217
|
+
track(mcpToolName(ctx.productName, "widget_duplicate")),
|
|
2218
|
+
{
|
|
2219
|
+
title: "Duplicate Widget",
|
|
2220
|
+
description: describeTool(
|
|
2221
|
+
"Copy a widget, optionally to a new grid position and under a new title."
|
|
2222
|
+
),
|
|
2223
|
+
annotations: WRITE,
|
|
2224
|
+
inputSchema: {
|
|
2225
|
+
id: zod.z.string().describe("Widget to copy"),
|
|
2226
|
+
newPosition: WidgetPosition.optional(),
|
|
2227
|
+
newTitle: zod.z.string().optional().describe("Title of the copy")
|
|
2228
|
+
}
|
|
2229
|
+
},
|
|
2230
|
+
async ({ id, newPosition, newTitle }) => gqlCall(
|
|
2231
|
+
ctx,
|
|
2232
|
+
"widget_duplicate",
|
|
2233
|
+
"duplicateWidget",
|
|
2234
|
+
DUPLICATE_WIDGET,
|
|
2235
|
+
definedInput({ id, newPosition, newTitle })
|
|
2236
|
+
)
|
|
2237
|
+
);
|
|
2238
|
+
server.registerTool(
|
|
2239
|
+
track(mcpToolName(ctx.productName, "widget_refresh_data")),
|
|
2240
|
+
{
|
|
2241
|
+
title: "Refresh Widget Data",
|
|
2242
|
+
description: describeTool(
|
|
2243
|
+
"Re-fetch the data behind a widget so the next render is current. Returns when it was fetched, not the data."
|
|
2244
|
+
),
|
|
2245
|
+
annotations: WRITE,
|
|
2246
|
+
inputSchema: { widgetId: zod.z.string().describe("Widget ID") }
|
|
2247
|
+
},
|
|
2248
|
+
async ({ widgetId }) => gqlCall(ctx, "widget_refresh_data", "refreshWidgetData", REFRESH_WIDGET_DATA, { widgetId })
|
|
2249
|
+
);
|
|
2250
|
+
server.registerTool(
|
|
2251
|
+
track(mcpToolName(ctx.productName, "widget_types")),
|
|
2252
|
+
{
|
|
2253
|
+
title: "List Widget Types",
|
|
2254
|
+
description: describeTool(
|
|
2255
|
+
"Every widget type BigConsole knows, with its default config and size. widget_create accepts only the nine render-verified ones; this lists the rest for reference."
|
|
2256
|
+
),
|
|
2257
|
+
annotations: READ_ONLY,
|
|
2258
|
+
inputSchema: {}
|
|
2259
|
+
},
|
|
2260
|
+
async () => gqlCall(ctx, "widget_types", "getWidgetTypes", GET_WIDGET_TYPES, {})
|
|
2261
|
+
);
|
|
2262
|
+
server.registerTool(
|
|
2263
|
+
track(mcpToolName(ctx.productName, "widget_renderers")),
|
|
2264
|
+
{
|
|
2265
|
+
title: "List Widget Renderers",
|
|
2266
|
+
description: describeTool(
|
|
2267
|
+
"The widget renderers available and the widget types each supports."
|
|
2268
|
+
),
|
|
2269
|
+
annotations: READ_ONLY,
|
|
2270
|
+
inputSchema: {}
|
|
2271
|
+
},
|
|
2272
|
+
async () => gqlCall(ctx, "widget_renderers", "getAvailableRenderers", GET_WIDGET_RENDERERS, {})
|
|
2273
|
+
);
|
|
1142
2274
|
}
|
|
1143
2275
|
|
|
1144
2276
|
// src/modules/bigconsole/index.ts
|
|
@@ -1159,6 +2291,9 @@ var bigconsoleModule = {
|
|
|
1159
2291
|
registerParserTools(server, ctx, track);
|
|
1160
2292
|
registerWidgetTools(server, ctx, track);
|
|
1161
2293
|
registerGenerateTools(server, ctx, track);
|
|
2294
|
+
registerPipelineTools(server, ctx, track);
|
|
2295
|
+
registerLinkedWorkflowTools(server, ctx, track);
|
|
2296
|
+
registerPromptTools(server, ctx, track);
|
|
1162
2297
|
return { tools, resources: [], prompts: [] };
|
|
1163
2298
|
}
|
|
1164
2299
|
};
|