@stackmemoryai/stackmemory 1.2.7 → 1.2.8
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/README.md +3 -3
- package/dist/src/cli/commands/digest.js +73 -0
- package/dist/src/cli/index.js +2 -0
- package/dist/src/core/digest/chronological-digest.js +143 -0
- package/dist/src/core/digest/index.js +1 -0
- package/dist/src/integrations/mcp/server.js +473 -247
- package/dist/src/integrations/mcp/tool-definitions.js +567 -50
- package/package.json +2 -2
- package/templates/claude-hooks/session-rescue.sh +3 -0
- /package/templates/claude-hooks/{auto-background-hook.js → archive/auto-background-hook.js} +0 -0
- /package/templates/claude-hooks/{hook-config.json → archive/hook-config.json} +0 -0
- /package/templates/claude-hooks/{hooks.json → archive/hooks.json} +0 -0
- /package/templates/claude-hooks/{on-compact-detected → archive/on-compact-detected} +0 -0
- /package/templates/claude-hooks/{on-exit → archive/on-exit} +0 -0
- /package/templates/claude-hooks/{post-edit-sweep.js → archive/post-edit-sweep.js} +0 -0
- /package/templates/claude-hooks/{pre-tool-use → archive/pre-tool-use} +0 -0
|
@@ -12,10 +12,18 @@ class MCPToolDefinitions {
|
|
|
12
12
|
...this.getTaskTools(),
|
|
13
13
|
...this.getLinearTools(),
|
|
14
14
|
...this.getTraceTools(),
|
|
15
|
+
...this.getTraceExtensionTools(),
|
|
16
|
+
...this.getPlanningTools(),
|
|
17
|
+
...this.getPendingTools(),
|
|
18
|
+
...this.getSmartContextTools(),
|
|
15
19
|
...this.getDiscoveryTools(),
|
|
16
20
|
...this.getEditTools(),
|
|
21
|
+
...this.getDiffMemTools(),
|
|
22
|
+
...this.getGreptileTools(),
|
|
23
|
+
...this.getProviderTools(),
|
|
17
24
|
...this.getTeamTools(),
|
|
18
|
-
...this.getCordTools()
|
|
25
|
+
...this.getCordTools(),
|
|
26
|
+
...this.getDigestTools()
|
|
19
27
|
];
|
|
20
28
|
}
|
|
21
29
|
/**
|
|
@@ -437,98 +445,238 @@ class MCPToolDefinitions {
|
|
|
437
445
|
}
|
|
438
446
|
}
|
|
439
447
|
}
|
|
448
|
+
}
|
|
449
|
+
];
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* Trace extension tools (statistics, flush, compress)
|
|
453
|
+
*/
|
|
454
|
+
getTraceExtensionTools() {
|
|
455
|
+
return [
|
|
456
|
+
{
|
|
457
|
+
name: "get_trace_statistics",
|
|
458
|
+
description: "Get statistics about detected traces",
|
|
459
|
+
inputSchema: { type: "object", properties: {} }
|
|
440
460
|
},
|
|
441
461
|
{
|
|
442
|
-
name: "
|
|
443
|
-
description: "
|
|
462
|
+
name: "flush_traces",
|
|
463
|
+
description: "Flush any pending trace and finalize detection",
|
|
464
|
+
inputSchema: { type: "object", properties: {} }
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
name: "compress_old_traces",
|
|
468
|
+
description: "Compress traces older than specified hours",
|
|
469
|
+
inputSchema: {
|
|
470
|
+
type: "object",
|
|
471
|
+
properties: {
|
|
472
|
+
ageHours: {
|
|
473
|
+
type: "number",
|
|
474
|
+
description: "Age threshold in hours (default: 24)"
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
];
|
|
480
|
+
}
|
|
481
|
+
/**
|
|
482
|
+
* Planning and orchestration tools
|
|
483
|
+
*/
|
|
484
|
+
getPlanningTools() {
|
|
485
|
+
return [
|
|
486
|
+
{
|
|
487
|
+
name: "plan_only",
|
|
488
|
+
description: "Generate an implementation plan (Claude) and return JSON only",
|
|
444
489
|
inputSchema: {
|
|
445
490
|
type: "object",
|
|
446
491
|
properties: {
|
|
447
|
-
|
|
492
|
+
task: { type: "string", description: "Task description" },
|
|
493
|
+
plannerModel: {
|
|
448
494
|
type: "string",
|
|
449
|
-
description: "
|
|
495
|
+
description: "Claude model for planning (optional)"
|
|
496
|
+
}
|
|
497
|
+
},
|
|
498
|
+
required: ["task"]
|
|
499
|
+
}
|
|
500
|
+
},
|
|
501
|
+
{
|
|
502
|
+
name: "call_codex",
|
|
503
|
+
description: "Invoke Codex via codex-sm with a prompt and args; dry-run by default",
|
|
504
|
+
inputSchema: {
|
|
505
|
+
type: "object",
|
|
506
|
+
properties: {
|
|
507
|
+
prompt: { type: "string", description: "Prompt for Codex" },
|
|
508
|
+
args: {
|
|
509
|
+
type: "array",
|
|
510
|
+
items: { type: "string" },
|
|
511
|
+
description: "Additional CLI args for codex-sm"
|
|
450
512
|
},
|
|
451
|
-
|
|
513
|
+
execute: {
|
|
452
514
|
type: "boolean",
|
|
453
515
|
default: false,
|
|
454
|
-
description: "
|
|
516
|
+
description: "Actually run codex-sm (otherwise dry-run)"
|
|
517
|
+
}
|
|
518
|
+
},
|
|
519
|
+
required: ["prompt"]
|
|
520
|
+
}
|
|
521
|
+
},
|
|
522
|
+
{
|
|
523
|
+
name: "call_claude",
|
|
524
|
+
description: "Invoke Claude with a prompt (Anthropic SDK)",
|
|
525
|
+
inputSchema: {
|
|
526
|
+
type: "object",
|
|
527
|
+
properties: {
|
|
528
|
+
prompt: { type: "string", description: "Prompt for Claude" },
|
|
529
|
+
model: { type: "string", description: "Claude model (optional)" },
|
|
530
|
+
system: { type: "string", description: "System prompt (optional)" }
|
|
531
|
+
},
|
|
532
|
+
required: ["prompt"]
|
|
533
|
+
}
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
name: "plan_gate",
|
|
537
|
+
description: "Phase 1: Generate a plan and return an approvalId for later execution",
|
|
538
|
+
inputSchema: {
|
|
539
|
+
type: "object",
|
|
540
|
+
properties: {
|
|
541
|
+
task: { type: "string", description: "Task description" },
|
|
542
|
+
plannerModel: {
|
|
543
|
+
type: "string",
|
|
544
|
+
description: "Claude model (optional)"
|
|
545
|
+
}
|
|
546
|
+
},
|
|
547
|
+
required: ["task"]
|
|
548
|
+
}
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
name: "approve_plan",
|
|
552
|
+
description: "Phase 2: Execute a previously generated plan by approvalId",
|
|
553
|
+
inputSchema: {
|
|
554
|
+
type: "object",
|
|
555
|
+
properties: {
|
|
556
|
+
approvalId: { type: "string", description: "Id from plan_gate" },
|
|
557
|
+
implementer: {
|
|
558
|
+
type: "string",
|
|
559
|
+
enum: ["codex", "claude"],
|
|
560
|
+
default: "codex",
|
|
561
|
+
description: "Which agent implements code"
|
|
455
562
|
},
|
|
456
|
-
|
|
563
|
+
maxIters: { type: "number", default: 2 },
|
|
564
|
+
recordFrame: { type: "boolean", default: true },
|
|
565
|
+
execute: { type: "boolean", default: true }
|
|
566
|
+
},
|
|
567
|
+
required: ["approvalId"]
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
];
|
|
571
|
+
}
|
|
572
|
+
/**
|
|
573
|
+
* Pending approval management tools
|
|
574
|
+
*/
|
|
575
|
+
getPendingTools() {
|
|
576
|
+
return [
|
|
577
|
+
{
|
|
578
|
+
name: "pending_list",
|
|
579
|
+
description: "List pending approval-gated plans (supports filters)",
|
|
580
|
+
inputSchema: {
|
|
581
|
+
type: "object",
|
|
582
|
+
properties: {
|
|
583
|
+
taskContains: {
|
|
584
|
+
type: "string",
|
|
585
|
+
description: "Filter tasks containing this substring"
|
|
586
|
+
},
|
|
587
|
+
olderThanMs: {
|
|
457
588
|
type: "number",
|
|
458
|
-
|
|
459
|
-
description: "Browser width"
|
|
589
|
+
description: "Only items older than this age (ms)"
|
|
460
590
|
},
|
|
461
|
-
|
|
591
|
+
newerThanMs: {
|
|
462
592
|
type: "number",
|
|
463
|
-
|
|
464
|
-
description: "Browser height"
|
|
593
|
+
description: "Only items newer than this age (ms)"
|
|
465
594
|
},
|
|
466
|
-
|
|
467
|
-
type: "
|
|
468
|
-
|
|
469
|
-
description: "
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
|
|
595
|
+
sort: {
|
|
596
|
+
type: "string",
|
|
597
|
+
enum: ["asc", "desc"],
|
|
598
|
+
description: "Sort by createdAt"
|
|
599
|
+
},
|
|
600
|
+
limit: { type: "number", description: "Max items to return" }
|
|
601
|
+
}
|
|
473
602
|
}
|
|
474
603
|
},
|
|
475
604
|
{
|
|
476
|
-
name: "
|
|
477
|
-
description: "
|
|
605
|
+
name: "pending_clear",
|
|
606
|
+
description: "Clear pending approval-gated plans (by id, all, or olderThanMs)",
|
|
478
607
|
inputSchema: {
|
|
479
608
|
type: "object",
|
|
480
609
|
properties: {
|
|
481
|
-
|
|
482
|
-
type: "string",
|
|
483
|
-
description: "Browser session ID"
|
|
484
|
-
},
|
|
485
|
-
selector: {
|
|
610
|
+
approvalId: {
|
|
486
611
|
type: "string",
|
|
487
|
-
description: "
|
|
612
|
+
description: "Clear a single approval by id"
|
|
488
613
|
},
|
|
489
|
-
|
|
614
|
+
all: {
|
|
490
615
|
type: "boolean",
|
|
491
616
|
default: false,
|
|
492
|
-
description: "
|
|
617
|
+
description: "Clear all pending approvals"
|
|
618
|
+
},
|
|
619
|
+
olderThanMs: {
|
|
620
|
+
type: "number",
|
|
621
|
+
description: "Clear approvals older than this age (ms)"
|
|
493
622
|
}
|
|
494
|
-
}
|
|
495
|
-
required: ["session_id"]
|
|
623
|
+
}
|
|
496
624
|
}
|
|
497
625
|
},
|
|
498
626
|
{
|
|
499
|
-
name: "
|
|
500
|
-
description: "
|
|
627
|
+
name: "pending_show",
|
|
628
|
+
description: "Show a pending plan by approvalId",
|
|
501
629
|
inputSchema: {
|
|
502
630
|
type: "object",
|
|
503
631
|
properties: {
|
|
504
|
-
|
|
632
|
+
approvalId: {
|
|
505
633
|
type: "string",
|
|
506
|
-
description: "
|
|
507
|
-
}
|
|
508
|
-
|
|
634
|
+
description: "Approval id from plan_gate"
|
|
635
|
+
}
|
|
636
|
+
},
|
|
637
|
+
required: ["approvalId"]
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
];
|
|
641
|
+
}
|
|
642
|
+
/**
|
|
643
|
+
* Smart context and summary tools
|
|
644
|
+
*/
|
|
645
|
+
getSmartContextTools() {
|
|
646
|
+
return [
|
|
647
|
+
{
|
|
648
|
+
name: "smart_context",
|
|
649
|
+
description: "LLM-driven context retrieval - intelligently selects relevant frames based on query",
|
|
650
|
+
inputSchema: {
|
|
651
|
+
type: "object",
|
|
652
|
+
properties: {
|
|
653
|
+
query: {
|
|
509
654
|
type: "string",
|
|
510
|
-
description: "
|
|
655
|
+
description: "Natural language query describing what context you need"
|
|
511
656
|
},
|
|
512
|
-
|
|
513
|
-
type: "
|
|
514
|
-
description: "
|
|
657
|
+
tokenBudget: {
|
|
658
|
+
type: "number",
|
|
659
|
+
description: "Maximum tokens to use for context (default: 4000)"
|
|
660
|
+
},
|
|
661
|
+
forceRefresh: {
|
|
662
|
+
type: "boolean",
|
|
663
|
+
description: "Force refresh of cached summaries"
|
|
515
664
|
}
|
|
516
665
|
},
|
|
517
|
-
required: ["
|
|
666
|
+
required: ["query"]
|
|
518
667
|
}
|
|
519
668
|
},
|
|
520
669
|
{
|
|
521
|
-
name: "
|
|
522
|
-
description: "
|
|
670
|
+
name: "get_summary",
|
|
671
|
+
description: "Get compressed summary of project memory for analysis",
|
|
523
672
|
inputSchema: {
|
|
524
673
|
type: "object",
|
|
525
674
|
properties: {
|
|
526
|
-
|
|
527
|
-
type: "
|
|
528
|
-
description: "
|
|
675
|
+
forceRefresh: {
|
|
676
|
+
type: "boolean",
|
|
677
|
+
description: "Force refresh of cached summary"
|
|
529
678
|
}
|
|
530
|
-
}
|
|
531
|
-
required: ["session_id"]
|
|
679
|
+
}
|
|
532
680
|
}
|
|
533
681
|
}
|
|
534
682
|
];
|
|
@@ -674,6 +822,359 @@ class MCPToolDefinitions {
|
|
|
674
822
|
}
|
|
675
823
|
];
|
|
676
824
|
}
|
|
825
|
+
/**
|
|
826
|
+
* DiffMem user memory management tools
|
|
827
|
+
*/
|
|
828
|
+
getDiffMemTools() {
|
|
829
|
+
return [
|
|
830
|
+
{
|
|
831
|
+
name: "diffmem_get_user_context",
|
|
832
|
+
description: "Fetch user knowledge and preferences from memory. Use to personalize responses.",
|
|
833
|
+
inputSchema: {
|
|
834
|
+
type: "object",
|
|
835
|
+
properties: {
|
|
836
|
+
categories: {
|
|
837
|
+
type: "array",
|
|
838
|
+
items: {
|
|
839
|
+
type: "string",
|
|
840
|
+
enum: [
|
|
841
|
+
"preference",
|
|
842
|
+
"expertise",
|
|
843
|
+
"project_knowledge",
|
|
844
|
+
"pattern",
|
|
845
|
+
"correction"
|
|
846
|
+
]
|
|
847
|
+
},
|
|
848
|
+
description: "Filter by memory categories"
|
|
849
|
+
},
|
|
850
|
+
limit: {
|
|
851
|
+
type: "number",
|
|
852
|
+
default: 10,
|
|
853
|
+
description: "Maximum memories to return"
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
},
|
|
858
|
+
{
|
|
859
|
+
name: "diffmem_store_learning",
|
|
860
|
+
description: "Store a new insight about the user (preference, expertise, pattern, or correction)",
|
|
861
|
+
inputSchema: {
|
|
862
|
+
type: "object",
|
|
863
|
+
properties: {
|
|
864
|
+
content: { type: "string", description: "The insight to store" },
|
|
865
|
+
category: {
|
|
866
|
+
type: "string",
|
|
867
|
+
enum: [
|
|
868
|
+
"preference",
|
|
869
|
+
"expertise",
|
|
870
|
+
"project_knowledge",
|
|
871
|
+
"pattern",
|
|
872
|
+
"correction"
|
|
873
|
+
],
|
|
874
|
+
description: "Category of the insight"
|
|
875
|
+
},
|
|
876
|
+
confidence: {
|
|
877
|
+
type: "number",
|
|
878
|
+
minimum: 0,
|
|
879
|
+
maximum: 1,
|
|
880
|
+
default: 0.7,
|
|
881
|
+
description: "Confidence level (0-1)"
|
|
882
|
+
},
|
|
883
|
+
context: {
|
|
884
|
+
type: "object",
|
|
885
|
+
description: "Additional context for the insight"
|
|
886
|
+
}
|
|
887
|
+
},
|
|
888
|
+
required: ["content", "category"]
|
|
889
|
+
}
|
|
890
|
+
},
|
|
891
|
+
{
|
|
892
|
+
name: "diffmem_search",
|
|
893
|
+
description: "Semantic search across user memories. Find relevant past insights and preferences.",
|
|
894
|
+
inputSchema: {
|
|
895
|
+
type: "object",
|
|
896
|
+
properties: {
|
|
897
|
+
query: { type: "string", description: "Search query" },
|
|
898
|
+
timeRange: {
|
|
899
|
+
type: "string",
|
|
900
|
+
enum: ["day", "week", "month", "all"],
|
|
901
|
+
default: "all",
|
|
902
|
+
description: "Time range filter"
|
|
903
|
+
},
|
|
904
|
+
minConfidence: {
|
|
905
|
+
type: "number",
|
|
906
|
+
minimum: 0,
|
|
907
|
+
maximum: 1,
|
|
908
|
+
default: 0.5,
|
|
909
|
+
description: "Minimum confidence threshold"
|
|
910
|
+
},
|
|
911
|
+
limit: {
|
|
912
|
+
type: "number",
|
|
913
|
+
default: 10,
|
|
914
|
+
description: "Maximum results"
|
|
915
|
+
}
|
|
916
|
+
},
|
|
917
|
+
required: ["query"]
|
|
918
|
+
}
|
|
919
|
+
},
|
|
920
|
+
{
|
|
921
|
+
name: "diffmem_status",
|
|
922
|
+
description: "Check DiffMem connection status and memory statistics",
|
|
923
|
+
inputSchema: { type: "object", properties: {} }
|
|
924
|
+
}
|
|
925
|
+
];
|
|
926
|
+
}
|
|
927
|
+
/**
|
|
928
|
+
* Greptile code review tools
|
|
929
|
+
*/
|
|
930
|
+
getGreptileTools() {
|
|
931
|
+
return [
|
|
932
|
+
{
|
|
933
|
+
name: "greptile_pr_comments",
|
|
934
|
+
description: "Get PR review comments from Greptile. Returns unaddressed comments with suggestedCode.",
|
|
935
|
+
inputSchema: {
|
|
936
|
+
type: "object",
|
|
937
|
+
properties: {
|
|
938
|
+
name: {
|
|
939
|
+
type: "string",
|
|
940
|
+
description: 'Repository full name (e.g., "owner/repo")'
|
|
941
|
+
},
|
|
942
|
+
remote: {
|
|
943
|
+
type: "string",
|
|
944
|
+
enum: ["github", "gitlab", "azure", "bitbucket"],
|
|
945
|
+
description: "Remote provider"
|
|
946
|
+
},
|
|
947
|
+
defaultBranch: {
|
|
948
|
+
type: "string",
|
|
949
|
+
description: 'Default branch (e.g., "main")'
|
|
950
|
+
},
|
|
951
|
+
prNumber: { type: "number", description: "Pull request number" },
|
|
952
|
+
greptileGenerated: {
|
|
953
|
+
type: "boolean",
|
|
954
|
+
description: "Filter for only Greptile review comments"
|
|
955
|
+
},
|
|
956
|
+
addressed: {
|
|
957
|
+
type: "boolean",
|
|
958
|
+
description: "Filter by comment addressed status"
|
|
959
|
+
}
|
|
960
|
+
},
|
|
961
|
+
required: ["name", "remote", "defaultBranch", "prNumber"]
|
|
962
|
+
}
|
|
963
|
+
},
|
|
964
|
+
{
|
|
965
|
+
name: "greptile_pr_details",
|
|
966
|
+
description: "Get detailed PR information including metadata, statistics, and review analysis.",
|
|
967
|
+
inputSchema: {
|
|
968
|
+
type: "object",
|
|
969
|
+
properties: {
|
|
970
|
+
name: { type: "string", description: "Repository full name" },
|
|
971
|
+
remote: {
|
|
972
|
+
type: "string",
|
|
973
|
+
enum: ["github", "gitlab", "azure", "bitbucket"],
|
|
974
|
+
description: "Remote provider"
|
|
975
|
+
},
|
|
976
|
+
defaultBranch: { type: "string", description: "Default branch" },
|
|
977
|
+
prNumber: { type: "number", description: "Pull request number" }
|
|
978
|
+
},
|
|
979
|
+
required: ["name", "remote", "defaultBranch", "prNumber"]
|
|
980
|
+
}
|
|
981
|
+
},
|
|
982
|
+
{
|
|
983
|
+
name: "greptile_list_prs",
|
|
984
|
+
description: "List pull requests. Filter by repository, branch, author, or state.",
|
|
985
|
+
inputSchema: {
|
|
986
|
+
type: "object",
|
|
987
|
+
properties: {
|
|
988
|
+
name: { type: "string", description: "Repository full name" },
|
|
989
|
+
remote: {
|
|
990
|
+
type: "string",
|
|
991
|
+
enum: ["github", "gitlab", "azure", "bitbucket"],
|
|
992
|
+
description: "Remote provider"
|
|
993
|
+
},
|
|
994
|
+
defaultBranch: { type: "string", description: "Default branch" },
|
|
995
|
+
sourceBranch: {
|
|
996
|
+
type: "string",
|
|
997
|
+
description: "Filter by source branch name"
|
|
998
|
+
},
|
|
999
|
+
authorLogin: {
|
|
1000
|
+
type: "string",
|
|
1001
|
+
description: "Filter by PR author username"
|
|
1002
|
+
},
|
|
1003
|
+
state: {
|
|
1004
|
+
type: "string",
|
|
1005
|
+
enum: ["open", "closed", "merged"],
|
|
1006
|
+
description: "Filter by PR state"
|
|
1007
|
+
},
|
|
1008
|
+
limit: { type: "number", description: "Max results (default 20)" }
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
},
|
|
1012
|
+
{
|
|
1013
|
+
name: "greptile_trigger_review",
|
|
1014
|
+
description: "Trigger a Greptile code review for a pull request.",
|
|
1015
|
+
inputSchema: {
|
|
1016
|
+
type: "object",
|
|
1017
|
+
properties: {
|
|
1018
|
+
name: { type: "string", description: "Repository full name" },
|
|
1019
|
+
remote: {
|
|
1020
|
+
type: "string",
|
|
1021
|
+
enum: ["github", "gitlab", "azure", "bitbucket"],
|
|
1022
|
+
description: "Remote provider"
|
|
1023
|
+
},
|
|
1024
|
+
defaultBranch: { type: "string", description: "Default branch" },
|
|
1025
|
+
prNumber: { type: "number", description: "Pull request number" },
|
|
1026
|
+
branch: { type: "string", description: "Current working branch" }
|
|
1027
|
+
},
|
|
1028
|
+
required: ["name", "remote", "prNumber"]
|
|
1029
|
+
}
|
|
1030
|
+
},
|
|
1031
|
+
{
|
|
1032
|
+
name: "greptile_search_patterns",
|
|
1033
|
+
description: "Search custom coding patterns and instructions in Greptile.",
|
|
1034
|
+
inputSchema: {
|
|
1035
|
+
type: "object",
|
|
1036
|
+
properties: {
|
|
1037
|
+
query: {
|
|
1038
|
+
type: "string",
|
|
1039
|
+
description: "Search query for pattern content"
|
|
1040
|
+
},
|
|
1041
|
+
limit: { type: "number", description: "Max results (default 10)" }
|
|
1042
|
+
},
|
|
1043
|
+
required: ["query"]
|
|
1044
|
+
}
|
|
1045
|
+
},
|
|
1046
|
+
{
|
|
1047
|
+
name: "greptile_create_pattern",
|
|
1048
|
+
description: "Create a new custom coding pattern or instruction in Greptile.",
|
|
1049
|
+
inputSchema: {
|
|
1050
|
+
type: "object",
|
|
1051
|
+
properties: {
|
|
1052
|
+
body: { type: "string", description: "Pattern content" },
|
|
1053
|
+
type: {
|
|
1054
|
+
type: "string",
|
|
1055
|
+
enum: ["CUSTOM_INSTRUCTION", "PATTERN"],
|
|
1056
|
+
description: "Context type"
|
|
1057
|
+
},
|
|
1058
|
+
scopes: {
|
|
1059
|
+
type: "object",
|
|
1060
|
+
description: "Boolean expression defining where this pattern applies"
|
|
1061
|
+
}
|
|
1062
|
+
},
|
|
1063
|
+
required: ["body"]
|
|
1064
|
+
}
|
|
1065
|
+
},
|
|
1066
|
+
{
|
|
1067
|
+
name: "greptile_status",
|
|
1068
|
+
description: "Check Greptile integration connection status.",
|
|
1069
|
+
inputSchema: { type: "object", properties: {} }
|
|
1070
|
+
}
|
|
1071
|
+
];
|
|
1072
|
+
}
|
|
1073
|
+
/**
|
|
1074
|
+
* Multi-provider routing tools
|
|
1075
|
+
*/
|
|
1076
|
+
getProviderTools() {
|
|
1077
|
+
return [
|
|
1078
|
+
{
|
|
1079
|
+
name: "delegate_to_model",
|
|
1080
|
+
description: "Route a prompt to a specific provider/model. Uses smart cost-based routing by default.",
|
|
1081
|
+
inputSchema: {
|
|
1082
|
+
type: "object",
|
|
1083
|
+
properties: {
|
|
1084
|
+
prompt: { type: "string", description: "The prompt to send" },
|
|
1085
|
+
provider: {
|
|
1086
|
+
type: "string",
|
|
1087
|
+
enum: [
|
|
1088
|
+
"anthropic",
|
|
1089
|
+
"cerebras",
|
|
1090
|
+
"deepinfra",
|
|
1091
|
+
"openai",
|
|
1092
|
+
"openrouter"
|
|
1093
|
+
],
|
|
1094
|
+
description: "Override provider"
|
|
1095
|
+
},
|
|
1096
|
+
model: { type: "string", description: "Override model name" },
|
|
1097
|
+
taskType: {
|
|
1098
|
+
type: "string",
|
|
1099
|
+
enum: ["linting", "context", "code", "testing", "review", "plan"],
|
|
1100
|
+
description: "Task type for auto-routing"
|
|
1101
|
+
},
|
|
1102
|
+
maxTokens: { type: "number", description: "Max tokens" },
|
|
1103
|
+
temperature: { type: "number" },
|
|
1104
|
+
system: { type: "string", description: "System prompt" }
|
|
1105
|
+
},
|
|
1106
|
+
required: ["prompt"]
|
|
1107
|
+
}
|
|
1108
|
+
},
|
|
1109
|
+
{
|
|
1110
|
+
name: "batch_submit",
|
|
1111
|
+
description: "Submit prompts to Anthropic Batch API (50% discount, async)",
|
|
1112
|
+
inputSchema: {
|
|
1113
|
+
type: "object",
|
|
1114
|
+
properties: {
|
|
1115
|
+
prompts: {
|
|
1116
|
+
type: "array",
|
|
1117
|
+
items: {
|
|
1118
|
+
type: "object",
|
|
1119
|
+
properties: {
|
|
1120
|
+
id: { type: "string" },
|
|
1121
|
+
prompt: { type: "string" },
|
|
1122
|
+
model: { type: "string" },
|
|
1123
|
+
maxTokens: { type: "number" },
|
|
1124
|
+
system: { type: "string" }
|
|
1125
|
+
},
|
|
1126
|
+
required: ["id", "prompt"]
|
|
1127
|
+
},
|
|
1128
|
+
description: "Array of prompts to batch"
|
|
1129
|
+
},
|
|
1130
|
+
description: {
|
|
1131
|
+
type: "string",
|
|
1132
|
+
description: "Batch job description"
|
|
1133
|
+
}
|
|
1134
|
+
},
|
|
1135
|
+
required: ["prompts"]
|
|
1136
|
+
}
|
|
1137
|
+
},
|
|
1138
|
+
{
|
|
1139
|
+
name: "batch_check",
|
|
1140
|
+
description: "Check status or retrieve results for a batch job",
|
|
1141
|
+
inputSchema: {
|
|
1142
|
+
type: "object",
|
|
1143
|
+
properties: {
|
|
1144
|
+
batchId: { type: "string", description: "Batch job ID" },
|
|
1145
|
+
retrieve: {
|
|
1146
|
+
type: "boolean",
|
|
1147
|
+
default: false,
|
|
1148
|
+
description: "Retrieve results if complete"
|
|
1149
|
+
}
|
|
1150
|
+
},
|
|
1151
|
+
required: ["batchId"]
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
1154
|
+
];
|
|
1155
|
+
}
|
|
1156
|
+
/**
|
|
1157
|
+
* Chronological digest tools
|
|
1158
|
+
*/
|
|
1159
|
+
getDigestTools() {
|
|
1160
|
+
return [
|
|
1161
|
+
{
|
|
1162
|
+
name: "sm_digest",
|
|
1163
|
+
description: "Generate a chronological activity digest for a time period",
|
|
1164
|
+
inputSchema: {
|
|
1165
|
+
type: "object",
|
|
1166
|
+
properties: {
|
|
1167
|
+
period: {
|
|
1168
|
+
type: "string",
|
|
1169
|
+
enum: ["today", "yesterday", "week"],
|
|
1170
|
+
description: "Time period for the digest"
|
|
1171
|
+
}
|
|
1172
|
+
},
|
|
1173
|
+
required: ["period"]
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
];
|
|
1177
|
+
}
|
|
677
1178
|
/**
|
|
678
1179
|
* Multi-agent team collaboration tools
|
|
679
1180
|
*/
|
|
@@ -901,14 +1402,30 @@ class MCPToolDefinitions {
|
|
|
901
1402
|
return this.getLinearTools();
|
|
902
1403
|
case "trace":
|
|
903
1404
|
return this.getTraceTools();
|
|
1405
|
+
case "trace_extension":
|
|
1406
|
+
return this.getTraceExtensionTools();
|
|
1407
|
+
case "planning":
|
|
1408
|
+
return this.getPlanningTools();
|
|
1409
|
+
case "pending":
|
|
1410
|
+
return this.getPendingTools();
|
|
1411
|
+
case "smart_context":
|
|
1412
|
+
return this.getSmartContextTools();
|
|
904
1413
|
case "discovery":
|
|
905
1414
|
return this.getDiscoveryTools();
|
|
906
1415
|
case "edit":
|
|
907
1416
|
return this.getEditTools();
|
|
1417
|
+
case "diffmem":
|
|
1418
|
+
return this.getDiffMemTools();
|
|
1419
|
+
case "greptile":
|
|
1420
|
+
return this.getGreptileTools();
|
|
1421
|
+
case "provider":
|
|
1422
|
+
return this.getProviderTools();
|
|
908
1423
|
case "team":
|
|
909
1424
|
return this.getTeamTools();
|
|
910
1425
|
case "cord":
|
|
911
1426
|
return this.getCordTools();
|
|
1427
|
+
case "digest":
|
|
1428
|
+
return this.getDigestTools();
|
|
912
1429
|
default:
|
|
913
1430
|
return [];
|
|
914
1431
|
}
|