mcp-adr-analysis-server 2.1.20 → 2.1.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (253) hide show
  1. package/README.md +63 -0
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/src/config/ai-config.d.ts +54 -6
  4. package/dist/src/config/ai-config.d.ts.map +1 -1
  5. package/dist/src/config/ai-config.js +69 -6
  6. package/dist/src/config/ai-config.js.map +1 -1
  7. package/dist/src/config/ape-descriptions.d.ts +77 -0
  8. package/dist/src/config/ape-descriptions.d.ts.map +1 -0
  9. package/dist/src/config/ape-descriptions.js +177 -0
  10. package/dist/src/config/ape-descriptions.js.map +1 -0
  11. package/dist/src/index.d.ts +40 -0
  12. package/dist/src/index.d.ts.map +1 -1
  13. package/dist/src/index.js +934 -8
  14. package/dist/src/index.js.map +1 -1
  15. package/dist/src/prompts/adr-suggestion-prompts.d.ts +5 -0
  16. package/dist/src/prompts/adr-suggestion-prompts.d.ts.map +1 -1
  17. package/dist/src/prompts/adr-suggestion-prompts.js +22 -1
  18. package/dist/src/prompts/adr-suggestion-prompts.js.map +1 -1
  19. package/dist/src/prompts/prompt-catalog.d.ts +95 -0
  20. package/dist/src/prompts/prompt-catalog.d.ts.map +1 -0
  21. package/dist/src/prompts/prompt-catalog.js +300 -0
  22. package/dist/src/prompts/prompt-catalog.js.map +1 -0
  23. package/dist/src/resources/adrs-discovered-resource.d.ts +124 -0
  24. package/dist/src/resources/adrs-discovered-resource.d.ts.map +1 -0
  25. package/dist/src/resources/adrs-discovered-resource.js +174 -0
  26. package/dist/src/resources/adrs-discovered-resource.js.map +1 -0
  27. package/dist/src/resources/adrs-review-resource.d.ts +82 -0
  28. package/dist/src/resources/adrs-review-resource.d.ts.map +1 -0
  29. package/dist/src/resources/adrs-review-resource.js +160 -0
  30. package/dist/src/resources/adrs-review-resource.js.map +1 -0
  31. package/dist/src/resources/architectural-context-resource.d.ts +95 -0
  32. package/dist/src/resources/architectural-context-resource.d.ts.map +1 -0
  33. package/dist/src/resources/architectural-context-resource.js +428 -0
  34. package/dist/src/resources/architectural-context-resource.js.map +1 -0
  35. package/dist/src/resources/conversation-snapshot-resource.d.ts +92 -0
  36. package/dist/src/resources/conversation-snapshot-resource.d.ts.map +1 -0
  37. package/dist/src/resources/conversation-snapshot-resource.js +122 -0
  38. package/dist/src/resources/conversation-snapshot-resource.js.map +1 -0
  39. package/dist/src/resources/deployment-status-resource.js +1 -1
  40. package/dist/src/resources/deployment-status-resource.js.map +1 -1
  41. package/dist/src/resources/environment-analysis-resource.js +1 -1
  42. package/dist/src/resources/environment-analysis-resource.js.map +1 -1
  43. package/dist/src/resources/knowledge-graph-resource.d.ts +129 -0
  44. package/dist/src/resources/knowledge-graph-resource.d.ts.map +1 -0
  45. package/dist/src/resources/knowledge-graph-resource.js +217 -0
  46. package/dist/src/resources/knowledge-graph-resource.js.map +1 -0
  47. package/dist/src/resources/memory-expand-resource.d.ts +90 -0
  48. package/dist/src/resources/memory-expand-resource.d.ts.map +1 -0
  49. package/dist/src/resources/memory-expand-resource.js +176 -0
  50. package/dist/src/resources/memory-expand-resource.js.map +1 -0
  51. package/dist/src/resources/memory-stats-resource.d.ts +77 -0
  52. package/dist/src/resources/memory-stats-resource.d.ts.map +1 -0
  53. package/dist/src/resources/memory-stats-resource.js +108 -0
  54. package/dist/src/resources/memory-stats-resource.js.map +1 -0
  55. package/dist/src/resources/project-metrics-resource.js +1 -1
  56. package/dist/src/resources/project-metrics-resource.js.map +1 -1
  57. package/dist/src/resources/resource-cache.d.ts.map +1 -1
  58. package/dist/src/resources/resource-cache.js +2 -1
  59. package/dist/src/resources/resource-cache.js.map +1 -1
  60. package/dist/src/resources/server-context-resource.d.ts +69 -0
  61. package/dist/src/resources/server-context-resource.d.ts.map +1 -0
  62. package/dist/src/resources/server-context-resource.js +104 -0
  63. package/dist/src/resources/server-context-resource.js.map +1 -0
  64. package/dist/src/resources/tool-catalog-resource.d.ts +122 -0
  65. package/dist/src/resources/tool-catalog-resource.d.ts.map +1 -0
  66. package/dist/src/resources/tool-catalog-resource.js +167 -0
  67. package/dist/src/resources/tool-catalog-resource.js.map +1 -0
  68. package/dist/src/tools/adr-aggregator-tools.d.ts +185 -0
  69. package/dist/src/tools/adr-aggregator-tools.d.ts.map +1 -0
  70. package/dist/src/tools/adr-aggregator-tools.js +872 -0
  71. package/dist/src/tools/adr-aggregator-tools.js.map +1 -0
  72. package/dist/src/tools/adr-bootstrap-validation-tool.d.ts.map +1 -1
  73. package/dist/src/tools/adr-bootstrap-validation-tool.js +7 -6
  74. package/dist/src/tools/adr-bootstrap-validation-tool.js.map +1 -1
  75. package/dist/src/tools/adr-suggestion-tool.d.ts +5 -0
  76. package/dist/src/tools/adr-suggestion-tool.d.ts.map +1 -1
  77. package/dist/src/tools/adr-suggestion-tool.js +40 -71
  78. package/dist/src/tools/adr-suggestion-tool.js.map +1 -1
  79. package/dist/src/tools/analyze-gaps-tool.d.ts +57 -0
  80. package/dist/src/tools/analyze-gaps-tool.d.ts.map +1 -0
  81. package/dist/src/tools/analyze-gaps-tool.js +727 -0
  82. package/dist/src/tools/analyze-gaps-tool.js.map +1 -0
  83. package/dist/src/tools/bootstrap-validation-loop-tool.d.ts +23 -1
  84. package/dist/src/tools/bootstrap-validation-loop-tool.d.ts.map +1 -1
  85. package/dist/src/tools/bootstrap-validation-loop-tool.js +15 -5
  86. package/dist/src/tools/bootstrap-validation-loop-tool.js.map +1 -1
  87. package/dist/src/tools/ce-mcp-tools.d.ts +291 -0
  88. package/dist/src/tools/ce-mcp-tools.d.ts.map +1 -0
  89. package/dist/src/tools/ce-mcp-tools.js +1188 -0
  90. package/dist/src/tools/ce-mcp-tools.js.map +1 -0
  91. package/dist/src/tools/content-masking-tool.d.ts +11 -0
  92. package/dist/src/tools/content-masking-tool.d.ts.map +1 -1
  93. package/dist/src/tools/content-masking-tool.js +13 -6
  94. package/dist/src/tools/content-masking-tool.js.map +1 -1
  95. package/dist/src/tools/deployment-readiness-tool.d.ts +11 -0
  96. package/dist/src/tools/deployment-readiness-tool.d.ts.map +1 -1
  97. package/dist/src/tools/deployment-readiness-tool.js +10 -4
  98. package/dist/src/tools/deployment-readiness-tool.js.map +1 -1
  99. package/dist/src/tools/environment-analysis-tool.d.ts +96 -1
  100. package/dist/src/tools/environment-analysis-tool.d.ts.map +1 -1
  101. package/dist/src/tools/environment-analysis-tool.js +38 -46
  102. package/dist/src/tools/environment-analysis-tool.js.map +1 -1
  103. package/dist/src/tools/research-question-tool.d.ts.map +1 -1
  104. package/dist/src/tools/research-question-tool.js +3 -2
  105. package/dist/src/tools/research-question-tool.js.map +1 -1
  106. package/dist/src/tools/review-existing-adrs-tool.d.ts +5 -0
  107. package/dist/src/tools/review-existing-adrs-tool.d.ts.map +1 -1
  108. package/dist/src/tools/review-existing-adrs-tool.js +123 -42
  109. package/dist/src/tools/review-existing-adrs-tool.js.map +1 -1
  110. package/dist/src/tools/rule-generation-tool.d.ts.map +1 -1
  111. package/dist/src/tools/rule-generation-tool.js +3 -5
  112. package/dist/src/tools/rule-generation-tool.js.map +1 -1
  113. package/dist/src/tools/search-codebase-tool.d.ts +148 -0
  114. package/dist/src/tools/search-codebase-tool.d.ts.map +1 -0
  115. package/dist/src/tools/search-codebase-tool.js +406 -0
  116. package/dist/src/tools/search-codebase-tool.js.map +1 -0
  117. package/dist/src/tools/smart-git-push-tool-v2.js +1 -1
  118. package/dist/src/tools/smart-git-push-tool-v2.js.map +1 -1
  119. package/dist/src/tools/tool-catalog.d.ts +134 -0
  120. package/dist/src/tools/tool-catalog.d.ts.map +1 -0
  121. package/dist/src/tools/tool-catalog.js +1813 -0
  122. package/dist/src/tools/tool-catalog.js.map +1 -0
  123. package/dist/src/tools/tool-chain-orchestrator.d.ts +11 -2
  124. package/dist/src/tools/tool-chain-orchestrator.d.ts.map +1 -1
  125. package/dist/src/tools/tool-chain-orchestrator.js +11 -2
  126. package/dist/src/tools/tool-chain-orchestrator.js.map +1 -1
  127. package/dist/src/tools/tool-dispatcher.d.ts +98 -0
  128. package/dist/src/tools/tool-dispatcher.d.ts.map +1 -0
  129. package/dist/src/tools/tool-dispatcher.js +229 -0
  130. package/dist/src/tools/tool-dispatcher.js.map +1 -0
  131. package/dist/src/tools/tree-sitter-code-tools.d.ts +184 -0
  132. package/dist/src/tools/tree-sitter-code-tools.d.ts.map +1 -0
  133. package/dist/src/tools/tree-sitter-code-tools.js +642 -0
  134. package/dist/src/tools/tree-sitter-code-tools.js.map +1 -0
  135. package/dist/src/tools/troubleshoot-guided-workflow-tool.d.ts +22 -0
  136. package/dist/src/tools/troubleshoot-guided-workflow-tool.d.ts.map +1 -1
  137. package/dist/src/tools/troubleshoot-guided-workflow-tool.js +20 -3
  138. package/dist/src/tools/troubleshoot-guided-workflow-tool.js.map +1 -1
  139. package/dist/src/tools/update-knowledge-tool.d.ts +89 -0
  140. package/dist/src/tools/update-knowledge-tool.d.ts.map +1 -0
  141. package/dist/src/tools/update-knowledge-tool.js +222 -0
  142. package/dist/src/tools/update-knowledge-tool.js.map +1 -0
  143. package/dist/src/types/adr-aggregator.d.ts +692 -0
  144. package/dist/src/types/adr-aggregator.d.ts.map +1 -0
  145. package/dist/src/types/adr-aggregator.js +8 -0
  146. package/dist/src/types/adr-aggregator.js.map +1 -0
  147. package/dist/src/types/ce-mcp.d.ts +248 -0
  148. package/dist/src/types/ce-mcp.d.ts.map +1 -0
  149. package/dist/src/types/ce-mcp.js +27 -0
  150. package/dist/src/types/ce-mcp.js.map +1 -0
  151. package/dist/src/types/index.d.ts +3 -2
  152. package/dist/src/types/index.d.ts.map +1 -1
  153. package/dist/src/types/memory-entities.d.ts +48 -48
  154. package/dist/src/utils/adr-aggregator-client.d.ts +177 -0
  155. package/dist/src/utils/adr-aggregator-client.d.ts.map +1 -0
  156. package/dist/src/utils/adr-aggregator-client.js +396 -0
  157. package/dist/src/utils/adr-aggregator-client.js.map +1 -0
  158. package/dist/src/utils/adr-context-detector.js +1 -1
  159. package/dist/src/utils/adr-context-detector.js.map +1 -1
  160. package/dist/src/utils/adr-planning-task-integration.d.ts +260 -0
  161. package/dist/src/utils/adr-planning-task-integration.d.ts.map +1 -0
  162. package/dist/src/utils/adr-planning-task-integration.js +466 -0
  163. package/dist/src/utils/adr-planning-task-integration.js.map +1 -0
  164. package/dist/src/utils/adr-timeline-extractor.d.ts.map +1 -1
  165. package/dist/src/utils/adr-timeline-extractor.js +3 -2
  166. package/dist/src/utils/adr-timeline-extractor.js.map +1 -1
  167. package/dist/src/utils/ai-executor.d.ts +10 -0
  168. package/dist/src/utils/ai-executor.d.ts.map +1 -1
  169. package/dist/src/utils/ai-executor.js +14 -3
  170. package/dist/src/utils/ai-executor.js.map +1 -1
  171. package/dist/src/utils/automatic-prompt-engineering.d.ts +5 -0
  172. package/dist/src/utils/automatic-prompt-engineering.d.ts.map +1 -1
  173. package/dist/src/utils/automatic-prompt-engineering.js +10 -90
  174. package/dist/src/utils/automatic-prompt-engineering.js.map +1 -1
  175. package/dist/src/utils/bootstrap-task-integration.d.ts +214 -0
  176. package/dist/src/utils/bootstrap-task-integration.d.ts.map +1 -0
  177. package/dist/src/utils/bootstrap-task-integration.js +365 -0
  178. package/dist/src/utils/bootstrap-task-integration.js.map +1 -0
  179. package/dist/src/utils/config.d.ts +3 -0
  180. package/dist/src/utils/config.d.ts.map +1 -1
  181. package/dist/src/utils/config.js +13 -0
  182. package/dist/src/utils/config.js.map +1 -1
  183. package/dist/src/utils/dag-executor.js +1 -1
  184. package/dist/src/utils/dag-executor.js.map +1 -1
  185. package/dist/src/utils/deployment-task-integration.d.ts +260 -0
  186. package/dist/src/utils/deployment-task-integration.d.ts.map +1 -0
  187. package/dist/src/utils/deployment-task-integration.js +393 -0
  188. package/dist/src/utils/deployment-task-integration.js.map +1 -0
  189. package/dist/src/utils/dynamic-deployment-intelligence.js +1 -1
  190. package/dist/src/utils/dynamic-deployment-intelligence.js.map +1 -1
  191. package/dist/src/utils/enhanced-logging.d.ts +3 -0
  192. package/dist/src/utils/enhanced-logging.d.ts.map +1 -1
  193. package/dist/src/utils/enhanced-logging.js +9 -30
  194. package/dist/src/utils/enhanced-logging.js.map +1 -1
  195. package/dist/src/utils/environment-capability-registry.js +1 -1
  196. package/dist/src/utils/environment-capability-registry.js.map +1 -1
  197. package/dist/src/utils/file-system.d.ts.map +1 -1
  198. package/dist/src/utils/file-system.js +33 -3
  199. package/dist/src/utils/file-system.js.map +1 -1
  200. package/dist/src/utils/git-remote-detector.d.ts +67 -0
  201. package/dist/src/utils/git-remote-detector.d.ts.map +1 -0
  202. package/dist/src/utils/git-remote-detector.js +194 -0
  203. package/dist/src/utils/git-remote-detector.js.map +1 -0
  204. package/dist/src/utils/gitleaks-detector.js +1 -1
  205. package/dist/src/utils/gitleaks-detector.js.map +1 -1
  206. package/dist/src/utils/knowledge-graph-manager.d.ts +13 -0
  207. package/dist/src/utils/knowledge-graph-manager.d.ts.map +1 -1
  208. package/dist/src/utils/knowledge-graph-manager.js +13 -0
  209. package/dist/src/utils/knowledge-graph-manager.js.map +1 -1
  210. package/dist/src/utils/prompt-execution.d.ts +29 -1
  211. package/dist/src/utils/prompt-execution.d.ts.map +1 -1
  212. package/dist/src/utils/prompt-execution.js +29 -1
  213. package/dist/src/utils/prompt-execution.js.map +1 -1
  214. package/dist/src/utils/research-orchestrator.d.ts +87 -1
  215. package/dist/src/utils/research-orchestrator.d.ts.map +1 -1
  216. package/dist/src/utils/research-orchestrator.js +121 -17
  217. package/dist/src/utils/research-orchestrator.js.map +1 -1
  218. package/dist/src/utils/research-task-integration.d.ts +297 -0
  219. package/dist/src/utils/research-task-integration.d.ts.map +1 -0
  220. package/dist/src/utils/research-task-integration.js +449 -0
  221. package/dist/src/utils/research-task-integration.js.map +1 -0
  222. package/dist/src/utils/ripgrep-wrapper.d.ts.map +1 -1
  223. package/dist/src/utils/ripgrep-wrapper.js +17 -3
  224. package/dist/src/utils/ripgrep-wrapper.js.map +1 -1
  225. package/dist/src/utils/sandbox-executor.d.ts +145 -0
  226. package/dist/src/utils/sandbox-executor.d.ts.map +1 -0
  227. package/dist/src/utils/sandbox-executor.js +642 -0
  228. package/dist/src/utils/sandbox-executor.js.map +1 -0
  229. package/dist/src/utils/server-context-generator.d.ts +5 -0
  230. package/dist/src/utils/server-context-generator.d.ts.map +1 -1
  231. package/dist/src/utils/server-context-generator.js +38 -0
  232. package/dist/src/utils/server-context-generator.js.map +1 -1
  233. package/dist/src/utils/task-manager.d.ts +239 -0
  234. package/dist/src/utils/task-manager.d.ts.map +1 -0
  235. package/dist/src/utils/task-manager.js +528 -0
  236. package/dist/src/utils/task-manager.js.map +1 -0
  237. package/dist/src/utils/task-persistence.d.ts +82 -0
  238. package/dist/src/utils/task-persistence.d.ts.map +1 -0
  239. package/dist/src/utils/task-persistence.js +248 -0
  240. package/dist/src/utils/task-persistence.js.map +1 -0
  241. package/dist/src/utils/test-aware-defaults.d.ts +57 -0
  242. package/dist/src/utils/test-aware-defaults.d.ts.map +1 -0
  243. package/dist/src/utils/test-aware-defaults.js +71 -0
  244. package/dist/src/utils/test-aware-defaults.js.map +1 -0
  245. package/dist/src/utils/tree-sitter-analyzer.d.ts +42 -5
  246. package/dist/src/utils/tree-sitter-analyzer.d.ts.map +1 -1
  247. package/dist/src/utils/tree-sitter-analyzer.js +499 -17
  248. package/dist/src/utils/tree-sitter-analyzer.js.map +1 -1
  249. package/package.json +24 -19
  250. package/dist/src/tools/smart-git-push-tool.d.ts +0 -55
  251. package/dist/src/tools/smart-git-push-tool.d.ts.map +0 -1
  252. package/dist/src/tools/smart-git-push-tool.js +0 -1011
  253. package/dist/src/tools/smart-git-push-tool.js.map +0 -1
@@ -0,0 +1,1813 @@
1
+ /**
2
+ * Tool Catalog - Dynamic Tool Discovery System
3
+ *
4
+ * This module provides a centralized registry of all MCP tools with metadata
5
+ * for dynamic discovery, categorization, and token-efficient listing.
6
+ *
7
+ * @see ADR-014: CE-MCP Architecture (Phase 3)
8
+ * @see docs/IMPLEMENTATION-PLAN.md
9
+ */
10
+ /**
11
+ * Tool Catalog Registry
12
+ *
13
+ * Central registry of all tools with metadata for dynamic discovery.
14
+ * Tools are organized by category and include search-friendly metadata.
15
+ */
16
+ export const TOOL_CATALOG = new Map();
17
+ // ============================================================================
18
+ // ANALYSIS & DISCOVERY TOOLS
19
+ // ============================================================================
20
+ TOOL_CATALOG.set('analyze_project_ecosystem', {
21
+ name: 'analyze_project_ecosystem',
22
+ shortDescription: 'Comprehensive project analysis with architectural insights',
23
+ fullDescription: 'Analyzes the entire project ecosystem including structure, dependencies, architecture patterns, and provides actionable recommendations. Supports knowledge enhancement and reflexion learning.',
24
+ category: 'analysis',
25
+ complexity: 'complex',
26
+ tokenCost: { min: 8000, max: 15000 },
27
+ hasCEMCPDirective: true,
28
+ relatedTools: ['get_architectural_context', 'analyze_environment', 'smart_score'],
29
+ keywords: ['project', 'analysis', 'architecture', 'ecosystem', 'comprehensive'],
30
+ requiresAI: true,
31
+ inputSchema: {
32
+ type: 'object',
33
+ properties: {
34
+ projectPath: { type: 'string', description: 'Path to the project to analyze' },
35
+ analysisDepth: {
36
+ type: 'string',
37
+ enum: ['basic', 'standard', 'comprehensive'],
38
+ default: 'comprehensive',
39
+ },
40
+ includeEnvironment: { type: 'boolean', default: true },
41
+ knowledgeEnhancement: { type: 'boolean', default: true },
42
+ learningEnabled: { type: 'boolean', default: true },
43
+ technologyFocus: { type: 'array', items: { type: 'string' } },
44
+ analysisScope: { type: 'array', items: { type: 'string' } },
45
+ },
46
+ required: ['projectPath'],
47
+ },
48
+ });
49
+ TOOL_CATALOG.set('get_architectural_context', {
50
+ name: 'get_architectural_context',
51
+ shortDescription: 'Retrieve architectural context and knowledge graph',
52
+ fullDescription: 'Retrieves the current architectural context including knowledge graph relationships, ADR decisions, and technology mappings.',
53
+ category: 'analysis',
54
+ complexity: 'moderate',
55
+ tokenCost: { min: 2000, max: 5000 },
56
+ hasCEMCPDirective: true, // Phase 4.3: Moderate tool - context assembly
57
+ relatedTools: ['analyze_project_ecosystem', 'discover_existing_adrs'],
58
+ keywords: ['architecture', 'context', 'knowledge', 'graph'],
59
+ requiresAI: false,
60
+ inputSchema: {
61
+ type: 'object',
62
+ properties: {
63
+ includeGraph: { type: 'boolean', default: true },
64
+ includeMetrics: { type: 'boolean', default: false },
65
+ },
66
+ },
67
+ });
68
+ TOOL_CATALOG.set('analyze_environment', {
69
+ name: 'analyze_environment',
70
+ shortDescription: 'Analyze deployment environment configuration',
71
+ fullDescription: 'Analyzes the deployment environment including containerization, CI/CD, cloud services, and infrastructure patterns.',
72
+ category: 'analysis',
73
+ complexity: 'moderate',
74
+ tokenCost: { min: 2000, max: 4000 },
75
+ hasCEMCPDirective: true,
76
+ relatedTools: ['deployment_readiness', 'analyze_deployment_progress'],
77
+ keywords: ['environment', 'deployment', 'infrastructure', 'container', 'ci/cd'],
78
+ requiresAI: true,
79
+ inputSchema: {
80
+ type: 'object',
81
+ properties: {
82
+ projectPath: { type: 'string', description: 'Path to the project' },
83
+ includeContainerization: { type: 'boolean', default: true },
84
+ includeCICD: { type: 'boolean', default: true },
85
+ includeCloudServices: { type: 'boolean', default: true },
86
+ },
87
+ required: ['projectPath'],
88
+ },
89
+ });
90
+ TOOL_CATALOG.set('smart_score', {
91
+ name: 'smart_score',
92
+ shortDescription: 'Calculate code quality and architecture scores',
93
+ fullDescription: 'Analyzes code quality metrics, architectural patterns, and best practices to generate comprehensive scoring.',
94
+ category: 'analysis',
95
+ complexity: 'moderate',
96
+ tokenCost: { min: 3000, max: 6000 },
97
+ hasCEMCPDirective: true, // Phase 4.2: CE-MCP directive added
98
+ relatedTools: ['analyze_project_ecosystem', 'validate_all_adrs'],
99
+ keywords: ['score', 'quality', 'metrics', 'analysis'],
100
+ requiresAI: true,
101
+ inputSchema: {
102
+ type: 'object',
103
+ properties: {
104
+ projectPath: { type: 'string' },
105
+ includeDetails: { type: 'boolean', default: true },
106
+ },
107
+ required: ['projectPath'],
108
+ },
109
+ });
110
+ // ============================================================================
111
+ // ADR MANAGEMENT TOOLS
112
+ // ============================================================================
113
+ TOOL_CATALOG.set('suggest_adrs', {
114
+ name: 'suggest_adrs',
115
+ shortDescription: 'Generate ADR suggestions based on project analysis',
116
+ fullDescription: 'Analyzes the project and suggests Architecture Decision Records based on detected patterns, technologies, and architectural decisions.',
117
+ category: 'adr',
118
+ complexity: 'complex',
119
+ tokenCost: { min: 3000, max: 6000 },
120
+ hasCEMCPDirective: true,
121
+ relatedTools: ['generate_adr_from_decision', 'discover_existing_adrs', 'validate_adr'],
122
+ keywords: ['adr', 'suggestion', 'architecture', 'decision', 'record'],
123
+ requiresAI: true,
124
+ inputSchema: {
125
+ type: 'object',
126
+ properties: {
127
+ projectPath: { type: 'string' },
128
+ focus: { type: 'array', items: { type: 'string' } },
129
+ maxSuggestions: { type: 'number', default: 5 },
130
+ },
131
+ required: ['projectPath'],
132
+ },
133
+ });
134
+ TOOL_CATALOG.set('generate_adr_from_decision', {
135
+ name: 'generate_adr_from_decision',
136
+ shortDescription: 'Create ADR from a specific decision',
137
+ fullDescription: 'Generates a complete ADR document from a described architectural decision, including context, consequences, and alternatives.',
138
+ category: 'adr',
139
+ complexity: 'moderate',
140
+ tokenCost: { min: 2000, max: 4000 },
141
+ hasCEMCPDirective: true, // Phase 4.3: Moderate tool - document generation
142
+ relatedTools: ['suggest_adrs', 'validate_adr'],
143
+ keywords: ['adr', 'generate', 'decision', 'document'],
144
+ requiresAI: true,
145
+ inputSchema: {
146
+ type: 'object',
147
+ properties: {
148
+ decision: { type: 'string', description: 'The architectural decision' },
149
+ context: { type: 'string', description: 'Context and background' },
150
+ outputPath: { type: 'string', description: 'Where to save the ADR' },
151
+ },
152
+ required: ['decision'],
153
+ },
154
+ });
155
+ TOOL_CATALOG.set('generate_adrs_from_prd', {
156
+ name: 'generate_adrs_from_prd',
157
+ shortDescription: 'Generate ADRs from PRD document',
158
+ fullDescription: 'Analyzes a Product Requirements Document and generates relevant Architecture Decision Records.',
159
+ category: 'adr',
160
+ complexity: 'complex',
161
+ tokenCost: { min: 4000, max: 8000 },
162
+ hasCEMCPDirective: true, // Phase 4.2: CE-MCP directive added
163
+ relatedTools: ['suggest_adrs', 'generate_adr_from_decision'],
164
+ keywords: ['adr', 'prd', 'requirements', 'generate'],
165
+ requiresAI: true,
166
+ inputSchema: {
167
+ type: 'object',
168
+ properties: {
169
+ prdPath: { type: 'string', description: 'Path to PRD document' },
170
+ outputDirectory: { type: 'string', description: 'Where to save ADRs' },
171
+ },
172
+ required: ['prdPath'],
173
+ },
174
+ });
175
+ TOOL_CATALOG.set('discover_existing_adrs', {
176
+ name: 'discover_existing_adrs',
177
+ shortDescription: 'Find and index existing ADRs',
178
+ fullDescription: 'Discovers and indexes existing ADR documents in the project.',
179
+ category: 'adr',
180
+ complexity: 'simple',
181
+ tokenCost: { min: 500, max: 1500 },
182
+ hasCEMCPDirective: true, // Phase 4.3: Simple tool - file discovery operation
183
+ relatedTools: ['validate_all_adrs', 'analyze_adr_timeline'],
184
+ keywords: ['adr', 'discover', 'find', 'index'],
185
+ requiresAI: false,
186
+ inputSchema: {
187
+ type: 'object',
188
+ properties: {
189
+ searchPaths: { type: 'array', items: { type: 'string' } },
190
+ includeDeprecated: { type: 'boolean', default: false },
191
+ },
192
+ },
193
+ });
194
+ TOOL_CATALOG.set('validate_adr', {
195
+ name: 'validate_adr',
196
+ shortDescription: 'Validate ADR structure and content',
197
+ fullDescription: 'Validates an ADR document for completeness, structure, and consistency with project patterns.',
198
+ category: 'adr',
199
+ complexity: 'simple',
200
+ tokenCost: { min: 500, max: 1500 },
201
+ hasCEMCPDirective: true, // Phase 4.3: Simple tool - single validation operation
202
+ relatedTools: ['validate_all_adrs', 'suggest_adrs'],
203
+ keywords: ['adr', 'validate', 'check', 'structure'],
204
+ requiresAI: false,
205
+ inputSchema: {
206
+ type: 'object',
207
+ properties: {
208
+ adrPath: { type: 'string', description: 'Path to ADR file' },
209
+ strictMode: { type: 'boolean', default: false },
210
+ },
211
+ required: ['adrPath'],
212
+ },
213
+ });
214
+ TOOL_CATALOG.set('validate_all_adrs', {
215
+ name: 'validate_all_adrs',
216
+ shortDescription: 'Validate all ADRs in project',
217
+ fullDescription: 'Validates all ADR documents in the project for consistency and completeness.',
218
+ category: 'adr',
219
+ complexity: 'moderate',
220
+ tokenCost: { min: 1000, max: 3000 },
221
+ hasCEMCPDirective: true, // Phase 4.3: Moderate tool - batch validation
222
+ relatedTools: ['validate_adr', 'discover_existing_adrs'],
223
+ keywords: ['adr', 'validate', 'all', 'batch'],
224
+ requiresAI: false,
225
+ inputSchema: {
226
+ type: 'object',
227
+ properties: {
228
+ includeWarnings: { type: 'boolean', default: true },
229
+ },
230
+ },
231
+ });
232
+ TOOL_CATALOG.set('analyze_adr_timeline', {
233
+ name: 'analyze_adr_timeline',
234
+ shortDescription: 'Analyze ADR evolution over time',
235
+ fullDescription: 'Analyzes the timeline of ADR decisions to understand architectural evolution.',
236
+ category: 'adr',
237
+ complexity: 'moderate',
238
+ tokenCost: { min: 1500, max: 3000 },
239
+ hasCEMCPDirective: true, // Phase 4.3: Moderate tool - timeline analysis
240
+ relatedTools: ['discover_existing_adrs', 'compare_adr_progress'],
241
+ keywords: ['adr', 'timeline', 'history', 'evolution'],
242
+ requiresAI: true,
243
+ inputSchema: {
244
+ type: 'object',
245
+ properties: {
246
+ startDate: { type: 'string', description: 'Start date for analysis' },
247
+ endDate: { type: 'string', description: 'End date for analysis' },
248
+ },
249
+ },
250
+ });
251
+ TOOL_CATALOG.set('compare_adr_progress', {
252
+ name: 'compare_adr_progress',
253
+ shortDescription: 'Compare ADR implementation progress',
254
+ fullDescription: 'Compares ADR decisions against actual implementation to measure progress.',
255
+ category: 'adr',
256
+ complexity: 'moderate',
257
+ tokenCost: { min: 2000, max: 4000 },
258
+ hasCEMCPDirective: true, // Phase 4.3: Moderate tool - progress comparison
259
+ relatedTools: ['analyze_adr_timeline', 'validate_all_adrs'],
260
+ keywords: ['adr', 'compare', 'progress', 'implementation'],
261
+ requiresAI: true,
262
+ inputSchema: {
263
+ type: 'object',
264
+ properties: {
265
+ adrIds: { type: 'array', items: { type: 'string' } },
266
+ },
267
+ },
268
+ });
269
+ TOOL_CATALOG.set('review_existing_adrs', {
270
+ name: 'review_existing_adrs',
271
+ shortDescription: 'Review and analyze existing ADRs',
272
+ fullDescription: 'Reviews existing ADRs for relevance, accuracy, and potential updates.',
273
+ category: 'adr',
274
+ complexity: 'moderate',
275
+ tokenCost: { min: 2000, max: 4000 },
276
+ hasCEMCPDirective: true, // Phase 4.3: Moderate tool - ADR review
277
+ relatedTools: ['validate_all_adrs', 'suggest_adrs'],
278
+ keywords: ['adr', 'review', 'analyze', 'update'],
279
+ requiresAI: true,
280
+ inputSchema: {
281
+ type: 'object',
282
+ properties: {
283
+ focusArea: { type: 'string' },
284
+ includeRecommendations: { type: 'boolean', default: true },
285
+ },
286
+ },
287
+ });
288
+ TOOL_CATALOG.set('generate_adr_bootstrap', {
289
+ name: 'generate_adr_bootstrap',
290
+ shortDescription: 'Bootstrap ADR infrastructure',
291
+ fullDescription: 'Sets up ADR infrastructure including templates, directory structure, and initial ADRs.',
292
+ category: 'adr',
293
+ complexity: 'simple',
294
+ tokenCost: { min: 500, max: 1500 },
295
+ hasCEMCPDirective: true, // Phase 4.3: Simple tool - setup/initialization
296
+ relatedTools: ['suggest_adrs', 'generate_adr_from_decision'],
297
+ keywords: ['adr', 'bootstrap', 'setup', 'initialize'],
298
+ requiresAI: false,
299
+ inputSchema: {
300
+ type: 'object',
301
+ properties: {
302
+ outputDirectory: { type: 'string', default: 'docs/adrs' },
303
+ includeTemplate: { type: 'boolean', default: true },
304
+ },
305
+ },
306
+ });
307
+ TOOL_CATALOG.set('interactive_adr_planning', {
308
+ name: 'interactive_adr_planning',
309
+ shortDescription: 'Interactive ADR planning session',
310
+ fullDescription: 'Guides through an interactive ADR planning session to identify and prioritize decisions.',
311
+ category: 'adr',
312
+ complexity: 'complex',
313
+ tokenCost: { min: 3000, max: 6000 },
314
+ hasCEMCPDirective: true, // Phase 4.2: CE-MCP directive added
315
+ relatedTools: ['suggest_adrs', 'generate_adr_from_decision'],
316
+ keywords: ['adr', 'planning', 'interactive', 'session'],
317
+ requiresAI: true,
318
+ inputSchema: {
319
+ type: 'object',
320
+ properties: {
321
+ projectPath: { type: 'string' },
322
+ sessionMode: { type: 'string', enum: ['guided', 'free-form'] },
323
+ },
324
+ required: ['projectPath'],
325
+ },
326
+ });
327
+ // ============================================================================
328
+ // CONTENT SECURITY TOOLS
329
+ // ============================================================================
330
+ TOOL_CATALOG.set('analyze_content_security', {
331
+ name: 'analyze_content_security',
332
+ shortDescription: 'Analyze content for security concerns',
333
+ fullDescription: 'Analyzes content for sensitive information, secrets, and security vulnerabilities.',
334
+ category: 'content-security',
335
+ complexity: 'moderate',
336
+ tokenCost: { min: 1500, max: 3000 },
337
+ hasCEMCPDirective: true, // Phase 4.3: Moderate tool - security analysis
338
+ relatedTools: ['generate_content_masking', 'validate_content_masking'],
339
+ keywords: ['security', 'content', 'analyze', 'secrets', 'sensitive'],
340
+ requiresAI: true,
341
+ inputSchema: {
342
+ type: 'object',
343
+ properties: {
344
+ content: { type: 'string', description: 'Content to analyze' },
345
+ filePath: { type: 'string', description: 'Or path to file' },
346
+ strictMode: { type: 'boolean', default: false },
347
+ },
348
+ },
349
+ });
350
+ TOOL_CATALOG.set('generate_content_masking', {
351
+ name: 'generate_content_masking',
352
+ shortDescription: 'Generate masking rules for content',
353
+ fullDescription: 'Generates content masking rules to protect sensitive information in outputs.',
354
+ category: 'content-security',
355
+ complexity: 'moderate',
356
+ tokenCost: { min: 1000, max: 2500 },
357
+ hasCEMCPDirective: true, // Phase 4.3: Moderate tool - masking rule generation
358
+ relatedTools: ['analyze_content_security', 'apply_basic_content_masking'],
359
+ keywords: ['masking', 'generate', 'rules', 'protection'],
360
+ requiresAI: true,
361
+ inputSchema: {
362
+ type: 'object',
363
+ properties: {
364
+ content: { type: 'string' },
365
+ maskingLevel: { type: 'string', enum: ['minimal', 'standard', 'aggressive'] },
366
+ },
367
+ required: ['content'],
368
+ },
369
+ });
370
+ TOOL_CATALOG.set('apply_basic_content_masking', {
371
+ name: 'apply_basic_content_masking',
372
+ shortDescription: 'Apply basic content masking',
373
+ fullDescription: 'Applies basic content masking using predefined patterns.',
374
+ category: 'content-security',
375
+ complexity: 'simple',
376
+ tokenCost: { min: 200, max: 500 },
377
+ hasCEMCPDirective: true, // Phase 4.3: Simple tool - single masking operation
378
+ relatedTools: ['generate_content_masking', 'configure_custom_patterns'],
379
+ keywords: ['masking', 'apply', 'basic', 'content'],
380
+ requiresAI: false,
381
+ inputSchema: {
382
+ type: 'object',
383
+ properties: {
384
+ content: { type: 'string' },
385
+ },
386
+ required: ['content'],
387
+ },
388
+ });
389
+ TOOL_CATALOG.set('configure_custom_patterns', {
390
+ name: 'configure_custom_patterns',
391
+ shortDescription: 'Configure custom masking patterns',
392
+ fullDescription: 'Configures custom patterns for content masking.',
393
+ category: 'content-security',
394
+ complexity: 'simple',
395
+ tokenCost: { min: 200, max: 500 },
396
+ hasCEMCPDirective: true, // Phase 4.3: Simple tool - pattern configuration
397
+ relatedTools: ['apply_basic_content_masking', 'validate_content_masking'],
398
+ keywords: ['patterns', 'configure', 'custom', 'masking'],
399
+ requiresAI: false,
400
+ inputSchema: {
401
+ type: 'object',
402
+ properties: {
403
+ patterns: { type: 'array', items: { type: 'object' } },
404
+ name: { type: 'string' },
405
+ },
406
+ required: ['patterns'],
407
+ },
408
+ });
409
+ TOOL_CATALOG.set('validate_content_masking', {
410
+ name: 'validate_content_masking',
411
+ shortDescription: 'Validate content masking effectiveness',
412
+ fullDescription: 'Validates that content masking is properly applied and effective.',
413
+ category: 'content-security',
414
+ complexity: 'simple',
415
+ tokenCost: { min: 300, max: 800 },
416
+ hasCEMCPDirective: true, // Phase 4.3: Simple tool - validation operation
417
+ relatedTools: ['apply_basic_content_masking', 'analyze_content_security'],
418
+ keywords: ['validate', 'masking', 'check', 'verify'],
419
+ requiresAI: false,
420
+ inputSchema: {
421
+ type: 'object',
422
+ properties: {
423
+ maskedContent: { type: 'string' },
424
+ originalContent: { type: 'string' },
425
+ },
426
+ required: ['maskedContent'],
427
+ },
428
+ });
429
+ TOOL_CATALOG.set('configure_output_masking', {
430
+ name: 'configure_output_masking',
431
+ shortDescription: 'Configure output masking settings',
432
+ fullDescription: 'Configures global output masking settings and rules.',
433
+ category: 'content-security',
434
+ complexity: 'simple',
435
+ tokenCost: { min: 200, max: 400 },
436
+ hasCEMCPDirective: true, // Phase 4.3: Simple tool - settings configuration
437
+ relatedTools: ['apply_basic_content_masking', 'configure_custom_patterns'],
438
+ keywords: ['configure', 'output', 'masking', 'settings'],
439
+ requiresAI: false,
440
+ inputSchema: {
441
+ type: 'object',
442
+ properties: {
443
+ enabled: { type: 'boolean' },
444
+ level: { type: 'string', enum: ['minimal', 'standard', 'aggressive'] },
445
+ },
446
+ },
447
+ });
448
+ // ============================================================================
449
+ // RESEARCH & INTEGRATION TOOLS
450
+ // ============================================================================
451
+ TOOL_CATALOG.set('perform_research', {
452
+ name: 'perform_research',
453
+ shortDescription: 'Perform research on a topic',
454
+ fullDescription: 'Performs comprehensive research on a given topic using web search and analysis.',
455
+ category: 'research',
456
+ complexity: 'complex',
457
+ tokenCost: { min: 4000, max: 10000 },
458
+ hasCEMCPDirective: true, // Phase 4.2: CE-MCP directive added
459
+ relatedTools: ['incorporate_research', 'generate_research_questions'],
460
+ keywords: ['research', 'search', 'investigate', 'topic'],
461
+ requiresAI: true,
462
+ inputSchema: {
463
+ type: 'object',
464
+ properties: {
465
+ topic: { type: 'string', description: 'Research topic' },
466
+ depth: { type: 'string', enum: ['quick', 'standard', 'deep'] },
467
+ outputFormat: { type: 'string', enum: ['summary', 'detailed', 'structured'] },
468
+ },
469
+ required: ['topic'],
470
+ },
471
+ });
472
+ TOOL_CATALOG.set('incorporate_research', {
473
+ name: 'incorporate_research',
474
+ shortDescription: 'Incorporate research findings',
475
+ fullDescription: 'Incorporates research findings into project documentation or knowledge base.',
476
+ category: 'research',
477
+ complexity: 'moderate',
478
+ tokenCost: { min: 2000, max: 4000 },
479
+ hasCEMCPDirective: true, // Phase 4.3: Moderate tool - research integration
480
+ relatedTools: ['perform_research', 'create_research_template'],
481
+ keywords: ['research', 'incorporate', 'integrate', 'findings'],
482
+ requiresAI: true,
483
+ inputSchema: {
484
+ type: 'object',
485
+ properties: {
486
+ researchId: { type: 'string' },
487
+ targetPath: { type: 'string' },
488
+ },
489
+ required: ['researchId'],
490
+ },
491
+ });
492
+ TOOL_CATALOG.set('generate_research_questions', {
493
+ name: 'generate_research_questions',
494
+ shortDescription: 'Generate research questions',
495
+ fullDescription: 'Generates research questions based on project context and identified gaps.',
496
+ category: 'research',
497
+ complexity: 'moderate',
498
+ tokenCost: { min: 1500, max: 3000 },
499
+ hasCEMCPDirective: true, // Phase 4.3: Moderate tool - question generation
500
+ relatedTools: ['perform_research', 'create_research_template'],
501
+ keywords: ['research', 'questions', 'generate', 'gaps'],
502
+ requiresAI: true,
503
+ inputSchema: {
504
+ type: 'object',
505
+ properties: {
506
+ context: { type: 'string' },
507
+ focus: { type: 'array', items: { type: 'string' } },
508
+ },
509
+ },
510
+ });
511
+ TOOL_CATALOG.set('create_research_template', {
512
+ name: 'create_research_template',
513
+ shortDescription: 'Create research template',
514
+ fullDescription: 'Creates a structured research template for a topic.',
515
+ category: 'research',
516
+ complexity: 'simple',
517
+ tokenCost: { min: 500, max: 1000 },
518
+ hasCEMCPDirective: true, // Phase 4.3: Simple tool - template generation
519
+ relatedTools: ['perform_research', 'incorporate_research'],
520
+ keywords: ['research', 'template', 'create', 'structure'],
521
+ requiresAI: false,
522
+ inputSchema: {
523
+ type: 'object',
524
+ properties: {
525
+ topic: { type: 'string' },
526
+ templateType: { type: 'string', enum: ['investigation', 'comparison', 'analysis'] },
527
+ },
528
+ required: ['topic'],
529
+ },
530
+ });
531
+ TOOL_CATALOG.set('llm_web_search', {
532
+ name: 'llm_web_search',
533
+ shortDescription: 'Web search via LLM',
534
+ fullDescription: 'Performs web searches with LLM-enhanced result analysis.',
535
+ category: 'research',
536
+ complexity: 'moderate',
537
+ tokenCost: { min: 2000, max: 5000 },
538
+ hasCEMCPDirective: true, // Phase 4.3: Moderate tool - LLM web search
539
+ relatedTools: ['perform_research', 'llm_cloud_management'],
540
+ keywords: ['search', 'web', 'llm', 'internet'],
541
+ requiresAI: true,
542
+ inputSchema: {
543
+ type: 'object',
544
+ properties: {
545
+ query: { type: 'string', description: 'Search query' },
546
+ maxResults: { type: 'number', default: 10 },
547
+ },
548
+ required: ['query'],
549
+ },
550
+ });
551
+ TOOL_CATALOG.set('llm_cloud_management', {
552
+ name: 'llm_cloud_management',
553
+ shortDescription: 'Cloud management via LLM',
554
+ fullDescription: 'Cloud resource management with LLM assistance.',
555
+ category: 'research',
556
+ complexity: 'complex',
557
+ tokenCost: { min: 3000, max: 6000 },
558
+ hasCEMCPDirective: true, // Phase 4.3: Complex tool - cloud management orchestration
559
+ relatedTools: ['llm_web_search', 'llm_database_management'],
560
+ keywords: ['cloud', 'management', 'llm', 'aws', 'gcp', 'azure'],
561
+ requiresAI: true,
562
+ inputSchema: {
563
+ type: 'object',
564
+ properties: {
565
+ operation: { type: 'string' },
566
+ provider: { type: 'string', enum: ['aws', 'gcp', 'azure'] },
567
+ },
568
+ required: ['operation'],
569
+ },
570
+ });
571
+ TOOL_CATALOG.set('llm_database_management', {
572
+ name: 'llm_database_management',
573
+ shortDescription: 'Database management via LLM',
574
+ fullDescription: 'Database operations with LLM assistance.',
575
+ category: 'research',
576
+ complexity: 'complex',
577
+ tokenCost: { min: 2500, max: 5000 },
578
+ hasCEMCPDirective: true, // Phase 4.3: Complex tool - database management orchestration
579
+ relatedTools: ['llm_cloud_management', 'llm_web_search'],
580
+ keywords: ['database', 'management', 'llm', 'sql', 'nosql'],
581
+ requiresAI: true,
582
+ inputSchema: {
583
+ type: 'object',
584
+ properties: {
585
+ operation: { type: 'string' },
586
+ databaseType: { type: 'string' },
587
+ },
588
+ required: ['operation'],
589
+ },
590
+ });
591
+ // ============================================================================
592
+ // DEPLOYMENT & OPERATIONS TOOLS
593
+ // ============================================================================
594
+ TOOL_CATALOG.set('deployment_readiness', {
595
+ name: 'deployment_readiness',
596
+ shortDescription: 'Check deployment readiness',
597
+ fullDescription: 'Validates deployment readiness with zero-tolerance for critical failures.',
598
+ category: 'deployment',
599
+ complexity: 'complex',
600
+ tokenCost: { min: 2000, max: 4000 },
601
+ hasCEMCPDirective: true,
602
+ relatedTools: ['smart_git_push', 'analyze_deployment_progress'],
603
+ keywords: ['deployment', 'readiness', 'validation', 'check'],
604
+ requiresAI: true,
605
+ inputSchema: {
606
+ type: 'object',
607
+ properties: {
608
+ projectPath: { type: 'string' },
609
+ environment: { type: 'string', enum: ['development', 'staging', 'production'] },
610
+ strictMode: { type: 'boolean', default: true },
611
+ },
612
+ required: ['projectPath'],
613
+ },
614
+ });
615
+ TOOL_CATALOG.set('smart_git_push', {
616
+ name: 'smart_git_push',
617
+ shortDescription: 'Intelligent git push operations',
618
+ fullDescription: 'Performs intelligent git operations with pre-push validation and conflict detection.',
619
+ category: 'deployment',
620
+ complexity: 'moderate',
621
+ tokenCost: { min: 1000, max: 2500 },
622
+ hasCEMCPDirective: true, // Phase 4.3: Moderate tool - git operations
623
+ relatedTools: ['deployment_readiness', 'analyze_deployment_progress'],
624
+ keywords: ['git', 'push', 'smart', 'deployment'],
625
+ requiresAI: false,
626
+ inputSchema: {
627
+ type: 'object',
628
+ properties: {
629
+ branch: { type: 'string' },
630
+ force: { type: 'boolean', default: false },
631
+ runTests: { type: 'boolean', default: true },
632
+ },
633
+ },
634
+ });
635
+ TOOL_CATALOG.set('bootstrap_validation_loop', {
636
+ name: 'bootstrap_validation_loop',
637
+ shortDescription: 'Bootstrap validation loop for deployment',
638
+ fullDescription: 'Initiates a validation loop for deployment using validated patterns.',
639
+ category: 'deployment',
640
+ complexity: 'complex',
641
+ tokenCost: { min: 3000, max: 6000 },
642
+ hasCEMCPDirective: true, // Phase 4.3: Complex tool - state machine validation
643
+ relatedTools: ['deployment_readiness', 'generate_deployment_guidance'],
644
+ keywords: ['bootstrap', 'validation', 'loop', 'deployment', 'patterns'],
645
+ requiresAI: true,
646
+ inputSchema: {
647
+ type: 'object',
648
+ properties: {
649
+ projectPath: { type: 'string' },
650
+ pattern: { type: 'string' },
651
+ },
652
+ required: ['projectPath'],
653
+ },
654
+ });
655
+ TOOL_CATALOG.set('analyze_deployment_progress', {
656
+ name: 'analyze_deployment_progress',
657
+ shortDescription: 'Analyze deployment progress',
658
+ fullDescription: 'Analyzes the progress of ongoing deployments.',
659
+ category: 'deployment',
660
+ complexity: 'moderate',
661
+ tokenCost: { min: 1500, max: 3000 },
662
+ hasCEMCPDirective: true, // Phase 4.3: Moderate tool - deployment tracking
663
+ relatedTools: ['deployment_readiness', 'generate_deployment_guidance'],
664
+ keywords: ['deployment', 'progress', 'analyze', 'status'],
665
+ requiresAI: false,
666
+ inputSchema: {
667
+ type: 'object',
668
+ properties: {
669
+ deploymentId: { type: 'string' },
670
+ includeMetrics: { type: 'boolean', default: true },
671
+ },
672
+ },
673
+ });
674
+ TOOL_CATALOG.set('generate_deployment_guidance', {
675
+ name: 'generate_deployment_guidance',
676
+ shortDescription: 'Generate deployment guidance',
677
+ fullDescription: 'Generates deployment guidance based on project configuration and best practices.',
678
+ category: 'deployment',
679
+ complexity: 'moderate',
680
+ tokenCost: { min: 2000, max: 4000 },
681
+ hasCEMCPDirective: true, // Phase 4.3: Moderate tool - guidance generation
682
+ relatedTools: ['deployment_readiness', 'bootstrap_validation_loop'],
683
+ keywords: ['deployment', 'guidance', 'generate', 'best-practices'],
684
+ requiresAI: true,
685
+ inputSchema: {
686
+ type: 'object',
687
+ properties: {
688
+ projectPath: { type: 'string' },
689
+ targetEnvironment: { type: 'string' },
690
+ },
691
+ required: ['projectPath'],
692
+ },
693
+ });
694
+ TOOL_CATALOG.set('troubleshoot_guided_workflow', {
695
+ name: 'troubleshoot_guided_workflow',
696
+ shortDescription: 'Guided troubleshooting workflow',
697
+ fullDescription: 'Provides guided troubleshooting for deployment and operational issues.',
698
+ category: 'deployment',
699
+ complexity: 'complex',
700
+ tokenCost: { min: 3000, max: 7000 },
701
+ hasCEMCPDirective: true, // Phase 4.2: CE-MCP directive added
702
+ relatedTools: ['deployment_readiness', 'analyze_deployment_progress'],
703
+ keywords: ['troubleshoot', 'guided', 'workflow', 'issues'],
704
+ requiresAI: true,
705
+ inputSchema: {
706
+ type: 'object',
707
+ properties: {
708
+ issue: { type: 'string', description: 'Issue description' },
709
+ context: { type: 'string' },
710
+ },
711
+ required: ['issue'],
712
+ },
713
+ });
714
+ // ============================================================================
715
+ // MEMORY & STATE TOOLS
716
+ // ============================================================================
717
+ TOOL_CATALOG.set('memory_loading', {
718
+ name: 'memory_loading',
719
+ shortDescription: 'Load memory context',
720
+ fullDescription: 'Loads memory context from previous sessions.',
721
+ category: 'memory',
722
+ complexity: 'simple',
723
+ tokenCost: { min: 500, max: 2000 },
724
+ hasCEMCPDirective: true, // Phase 4.3: Simple tool - memory retrieval
725
+ relatedTools: ['expand_memory', 'query_conversation_history'],
726
+ keywords: ['memory', 'load', 'context', 'session'],
727
+ requiresAI: false,
728
+ inputSchema: {
729
+ type: 'object',
730
+ properties: {
731
+ sessionId: { type: 'string' },
732
+ maxItems: { type: 'number', default: 100 },
733
+ },
734
+ },
735
+ });
736
+ TOOL_CATALOG.set('expand_memory', {
737
+ name: 'expand_memory',
738
+ shortDescription: 'Expand memory with new context',
739
+ fullDescription: 'Expands memory with additional context information.',
740
+ category: 'memory',
741
+ complexity: 'simple',
742
+ tokenCost: { min: 300, max: 800 },
743
+ hasCEMCPDirective: true, // Phase 4.3: Simple tool - memory storage
744
+ relatedTools: ['memory_loading', 'get_memory_stats'],
745
+ keywords: ['memory', 'expand', 'add', 'context'],
746
+ requiresAI: false,
747
+ inputSchema: {
748
+ type: 'object',
749
+ properties: {
750
+ key: { type: 'string' },
751
+ value: { type: 'object' },
752
+ },
753
+ required: ['key', 'value'],
754
+ },
755
+ });
756
+ TOOL_CATALOG.set('query_conversation_history', {
757
+ name: 'query_conversation_history',
758
+ shortDescription: 'Query conversation history',
759
+ fullDescription: 'Queries the conversation history for relevant context.',
760
+ category: 'memory',
761
+ complexity: 'simple',
762
+ tokenCost: { min: 500, max: 1500 },
763
+ hasCEMCPDirective: true, // Phase 4.3: Simple tool - history query
764
+ relatedTools: ['get_conversation_snapshot', 'memory_loading'],
765
+ keywords: ['conversation', 'history', 'query', 'search'],
766
+ requiresAI: false,
767
+ inputSchema: {
768
+ type: 'object',
769
+ properties: {
770
+ query: { type: 'string' },
771
+ limit: { type: 'number', default: 20 },
772
+ },
773
+ },
774
+ });
775
+ TOOL_CATALOG.set('get_conversation_snapshot', {
776
+ name: 'get_conversation_snapshot',
777
+ shortDescription: 'Get conversation snapshot',
778
+ fullDescription: 'Gets a snapshot of the current conversation state.',
779
+ category: 'memory',
780
+ complexity: 'simple',
781
+ tokenCost: { min: 300, max: 800 },
782
+ hasCEMCPDirective: true, // Phase 4.3: Simple tool - state snapshot
783
+ relatedTools: ['query_conversation_history', 'get_memory_stats'],
784
+ keywords: ['conversation', 'snapshot', 'state'],
785
+ requiresAI: false,
786
+ inputSchema: {
787
+ type: 'object',
788
+ properties: {
789
+ includeMetadata: { type: 'boolean', default: false },
790
+ },
791
+ },
792
+ });
793
+ TOOL_CATALOG.set('get_memory_stats', {
794
+ name: 'get_memory_stats',
795
+ shortDescription: 'Get memory statistics',
796
+ fullDescription: 'Gets statistics about memory usage and storage.',
797
+ category: 'memory',
798
+ complexity: 'simple',
799
+ tokenCost: { min: 200, max: 400 },
800
+ hasCEMCPDirective: true, // Phase 4.3: Simple tool - stats retrieval
801
+ relatedTools: ['memory_loading', 'expand_memory'],
802
+ keywords: ['memory', 'stats', 'statistics', 'usage'],
803
+ requiresAI: false,
804
+ inputSchema: {
805
+ type: 'object',
806
+ properties: {
807
+ detailed: { type: 'boolean', default: false },
808
+ },
809
+ },
810
+ });
811
+ TOOL_CATALOG.set('expand_analysis_section', {
812
+ name: 'expand_analysis_section',
813
+ shortDescription: 'Expand analysis section',
814
+ fullDescription: 'Expands a specific section of analysis with more detail.',
815
+ category: 'memory',
816
+ complexity: 'moderate',
817
+ tokenCost: { min: 1500, max: 3000 },
818
+ hasCEMCPDirective: true, // Phase 4.3: Moderate tool - section expansion
819
+ relatedTools: ['analyze_project_ecosystem', 'memory_loading'],
820
+ keywords: ['expand', 'analysis', 'section', 'detail'],
821
+ requiresAI: true,
822
+ inputSchema: {
823
+ type: 'object',
824
+ properties: {
825
+ sectionId: { type: 'string' },
826
+ depth: { type: 'string', enum: ['summary', 'detailed', 'comprehensive'] },
827
+ },
828
+ required: ['sectionId'],
829
+ },
830
+ });
831
+ // ============================================================================
832
+ // FILE SYSTEM TOOLS
833
+ // ============================================================================
834
+ TOOL_CATALOG.set('read_file', {
835
+ name: 'read_file',
836
+ shortDescription: 'Read file contents',
837
+ fullDescription: 'Reads the contents of a file.',
838
+ category: 'file-system',
839
+ complexity: 'simple',
840
+ tokenCost: { min: 100, max: 5000 },
841
+ hasCEMCPDirective: true, // Phase 4.3: Simple tool - file read operation
842
+ relatedTools: ['write_file', 'read_directory'],
843
+ keywords: ['file', 'read', 'contents'],
844
+ requiresAI: false,
845
+ inputSchema: {
846
+ type: 'object',
847
+ properties: {
848
+ path: { type: 'string', description: 'Path to file' },
849
+ },
850
+ required: ['path'],
851
+ },
852
+ });
853
+ TOOL_CATALOG.set('write_file', {
854
+ name: 'write_file',
855
+ shortDescription: 'Write file contents',
856
+ fullDescription: 'Writes content to a file.',
857
+ category: 'file-system',
858
+ complexity: 'simple',
859
+ tokenCost: { min: 100, max: 1000 },
860
+ hasCEMCPDirective: true, // Phase 4.3: Simple tool - file write operation
861
+ relatedTools: ['read_file', 'list_directory'],
862
+ keywords: ['file', 'write', 'save'],
863
+ requiresAI: false,
864
+ inputSchema: {
865
+ type: 'object',
866
+ properties: {
867
+ path: { type: 'string', description: 'Path to file' },
868
+ content: { type: 'string', description: 'Content to write' },
869
+ },
870
+ required: ['path', 'content'],
871
+ },
872
+ });
873
+ TOOL_CATALOG.set('read_directory', {
874
+ name: 'read_directory',
875
+ shortDescription: 'Read directory contents',
876
+ fullDescription: 'Lists contents of a directory.',
877
+ category: 'file-system',
878
+ complexity: 'simple',
879
+ tokenCost: { min: 100, max: 1000 },
880
+ hasCEMCPDirective: true, // Phase 4.3: Simple tool - directory read
881
+ relatedTools: ['read_file', 'list_directory'],
882
+ keywords: ['directory', 'read', 'list'],
883
+ requiresAI: false,
884
+ inputSchema: {
885
+ type: 'object',
886
+ properties: {
887
+ path: { type: 'string', description: 'Path to directory' },
888
+ recursive: { type: 'boolean', default: false },
889
+ },
890
+ required: ['path'],
891
+ },
892
+ });
893
+ TOOL_CATALOG.set('list_directory', {
894
+ name: 'list_directory',
895
+ shortDescription: 'List directory contents',
896
+ fullDescription: 'Lists files and directories in a path.',
897
+ category: 'file-system',
898
+ complexity: 'simple',
899
+ tokenCost: { min: 100, max: 500 },
900
+ hasCEMCPDirective: true, // Phase 4.3: Simple tool - directory listing
901
+ relatedTools: ['read_directory', 'read_file'],
902
+ keywords: ['directory', 'list', 'files'],
903
+ requiresAI: false,
904
+ inputSchema: {
905
+ type: 'object',
906
+ properties: {
907
+ path: { type: 'string', description: 'Path to directory' },
908
+ },
909
+ required: ['path'],
910
+ },
911
+ });
912
+ TOOL_CATALOG.set('list_roots', {
913
+ name: 'list_roots',
914
+ shortDescription: 'List root directories',
915
+ fullDescription: 'Lists configured root directories.',
916
+ category: 'file-system',
917
+ complexity: 'simple',
918
+ tokenCost: { min: 50, max: 200 },
919
+ hasCEMCPDirective: true, // Phase 4.3: Simple tool - root listing
920
+ relatedTools: ['read_directory', 'list_directory'],
921
+ keywords: ['roots', 'list', 'directories'],
922
+ requiresAI: false,
923
+ inputSchema: {
924
+ type: 'object',
925
+ properties: {},
926
+ },
927
+ });
928
+ // ============================================================================
929
+ // RULES & VALIDATION TOOLS
930
+ // ============================================================================
931
+ TOOL_CATALOG.set('generate_rules', {
932
+ name: 'generate_rules',
933
+ shortDescription: 'Generate validation rules',
934
+ fullDescription: 'Generates validation rules based on project patterns and best practices.',
935
+ category: 'rules',
936
+ complexity: 'complex',
937
+ tokenCost: { min: 3000, max: 6000 },
938
+ hasCEMCPDirective: true,
939
+ relatedTools: ['validate_rules', 'create_rule_set'],
940
+ keywords: ['rules', 'generate', 'validation', 'patterns'],
941
+ requiresAI: true,
942
+ inputSchema: {
943
+ type: 'object',
944
+ properties: {
945
+ projectPath: { type: 'string' },
946
+ ruleType: { type: 'string', enum: ['code', 'architecture', 'deployment'] },
947
+ outputFormat: { type: 'string', enum: ['json', 'yaml', 'typescript'] },
948
+ },
949
+ required: ['projectPath'],
950
+ },
951
+ });
952
+ TOOL_CATALOG.set('validate_rules', {
953
+ name: 'validate_rules',
954
+ shortDescription: 'Validate rules against codebase',
955
+ fullDescription: 'Validates rules against the codebase and reports violations.',
956
+ category: 'rules',
957
+ complexity: 'moderate',
958
+ tokenCost: { min: 1500, max: 3000 },
959
+ hasCEMCPDirective: true, // Phase 4.3: Moderate tool - rule validation
960
+ relatedTools: ['generate_rules', 'create_rule_set'],
961
+ keywords: ['rules', 'validate', 'check', 'violations'],
962
+ requiresAI: false,
963
+ inputSchema: {
964
+ type: 'object',
965
+ properties: {
966
+ rulePath: { type: 'string' },
967
+ targetPath: { type: 'string' },
968
+ },
969
+ required: ['rulePath'],
970
+ },
971
+ });
972
+ TOOL_CATALOG.set('create_rule_set', {
973
+ name: 'create_rule_set',
974
+ shortDescription: 'Create rule set',
975
+ fullDescription: 'Creates a new rule set configuration.',
976
+ category: 'rules',
977
+ complexity: 'simple',
978
+ tokenCost: { min: 500, max: 1000 },
979
+ hasCEMCPDirective: true, // Phase 4.3: Simple tool - rule set creation
980
+ relatedTools: ['generate_rules', 'validate_rules'],
981
+ keywords: ['rules', 'create', 'set', 'configuration'],
982
+ requiresAI: false,
983
+ inputSchema: {
984
+ type: 'object',
985
+ properties: {
986
+ name: { type: 'string' },
987
+ rules: { type: 'array', items: { type: 'object' } },
988
+ },
989
+ required: ['name', 'rules'],
990
+ },
991
+ });
992
+ // ============================================================================
993
+ // WORKFLOW & GUIDANCE TOOLS
994
+ // ============================================================================
995
+ TOOL_CATALOG.set('get_workflow_guidance', {
996
+ name: 'get_workflow_guidance',
997
+ shortDescription: 'Get workflow guidance',
998
+ fullDescription: 'Provides guidance for specific workflows.',
999
+ category: 'workflow',
1000
+ complexity: 'moderate',
1001
+ tokenCost: { min: 1500, max: 3000 },
1002
+ hasCEMCPDirective: true, // Phase 4.3: Moderate tool - workflow guidance
1003
+ relatedTools: ['get_development_guidance', 'mcp_planning'],
1004
+ keywords: ['workflow', 'guidance', 'help', 'process'],
1005
+ requiresAI: true,
1006
+ inputSchema: {
1007
+ type: 'object',
1008
+ properties: {
1009
+ workflowType: { type: 'string' },
1010
+ context: { type: 'string' },
1011
+ },
1012
+ required: ['workflowType'],
1013
+ },
1014
+ });
1015
+ TOOL_CATALOG.set('get_development_guidance', {
1016
+ name: 'get_development_guidance',
1017
+ shortDescription: 'Get development guidance',
1018
+ fullDescription: 'Provides development guidance and best practices.',
1019
+ category: 'workflow',
1020
+ complexity: 'moderate',
1021
+ tokenCost: { min: 1500, max: 3000 },
1022
+ hasCEMCPDirective: true, // Phase 4.3: Moderate tool - development guidance
1023
+ relatedTools: ['get_workflow_guidance', 'mcp_planning'],
1024
+ keywords: ['development', 'guidance', 'best-practices'],
1025
+ requiresAI: true,
1026
+ inputSchema: {
1027
+ type: 'object',
1028
+ properties: {
1029
+ topic: { type: 'string' },
1030
+ level: { type: 'string', enum: ['beginner', 'intermediate', 'advanced'] },
1031
+ },
1032
+ required: ['topic'],
1033
+ },
1034
+ });
1035
+ TOOL_CATALOG.set('mcp_planning', {
1036
+ name: 'mcp_planning',
1037
+ shortDescription: 'MCP planning assistant',
1038
+ fullDescription: 'Assists with MCP server planning and design.',
1039
+ category: 'workflow',
1040
+ complexity: 'complex',
1041
+ tokenCost: { min: 3000, max: 6000 },
1042
+ hasCEMCPDirective: true, // Phase 4.2: CE-MCP directive added
1043
+ relatedTools: ['get_workflow_guidance', 'tool_chain_orchestrator'],
1044
+ keywords: ['mcp', 'planning', 'design', 'server'],
1045
+ requiresAI: true,
1046
+ inputSchema: {
1047
+ type: 'object',
1048
+ properties: {
1049
+ goal: { type: 'string' },
1050
+ constraints: { type: 'array', items: { type: 'string' } },
1051
+ },
1052
+ required: ['goal'],
1053
+ },
1054
+ });
1055
+ TOOL_CATALOG.set('tool_chain_orchestrator', {
1056
+ name: 'tool_chain_orchestrator',
1057
+ shortDescription: 'Orchestrate tool chains',
1058
+ fullDescription: 'Orchestrates multiple tools in a workflow chain.',
1059
+ category: 'workflow',
1060
+ complexity: 'complex',
1061
+ tokenCost: { min: 2000, max: 5000 },
1062
+ hasCEMCPDirective: true, // Phase 4.3: Complex tool - multi-tool orchestration
1063
+ relatedTools: ['mcp_planning', 'get_workflow_guidance'],
1064
+ keywords: ['orchestrator', 'tools', 'chain', 'workflow'],
1065
+ requiresAI: true,
1066
+ inputSchema: {
1067
+ type: 'object',
1068
+ properties: {
1069
+ chain: { type: 'array', items: { type: 'object' } },
1070
+ mode: { type: 'string', enum: ['sequential', 'parallel'] },
1071
+ },
1072
+ required: ['chain'],
1073
+ },
1074
+ });
1075
+ TOOL_CATALOG.set('request_action_confirmation', {
1076
+ name: 'request_action_confirmation',
1077
+ shortDescription: 'Request action confirmation',
1078
+ fullDescription: 'Requests user confirmation for actions.',
1079
+ category: 'workflow',
1080
+ complexity: 'simple',
1081
+ tokenCost: { min: 100, max: 300 },
1082
+ hasCEMCPDirective: true, // Phase 4.3: Simple tool - confirmation request
1083
+ relatedTools: ['tool_chain_orchestrator'],
1084
+ keywords: ['confirmation', 'request', 'action', 'approve'],
1085
+ requiresAI: false,
1086
+ inputSchema: {
1087
+ type: 'object',
1088
+ properties: {
1089
+ action: { type: 'string', description: 'Action to confirm' },
1090
+ details: { type: 'string' },
1091
+ },
1092
+ required: ['action'],
1093
+ },
1094
+ });
1095
+ // ============================================================================
1096
+ // UTILITY TOOLS
1097
+ // ============================================================================
1098
+ TOOL_CATALOG.set('manage_cache', {
1099
+ name: 'manage_cache',
1100
+ shortDescription: 'Manage cache operations',
1101
+ fullDescription: 'Manages cache operations including clear, stats, and cleanup.',
1102
+ category: 'utility',
1103
+ complexity: 'simple',
1104
+ tokenCost: { min: 100, max: 500 },
1105
+ hasCEMCPDirective: true, // Phase 4.3: Simple tool - cache management
1106
+ relatedTools: ['get_server_context', 'get_memory_stats'],
1107
+ keywords: ['cache', 'manage', 'clear', 'cleanup'],
1108
+ requiresAI: false,
1109
+ inputSchema: {
1110
+ type: 'object',
1111
+ properties: {
1112
+ action: { type: 'string', enum: ['clear', 'stats', 'cleanup', 'invalidate'] },
1113
+ key: { type: 'string' },
1114
+ },
1115
+ required: ['action'],
1116
+ },
1117
+ });
1118
+ TOOL_CATALOG.set('check_ai_execution_status', {
1119
+ name: 'check_ai_execution_status',
1120
+ shortDescription: 'Check AI execution status',
1121
+ fullDescription: 'Checks the status of AI execution capabilities.',
1122
+ category: 'utility',
1123
+ complexity: 'simple',
1124
+ tokenCost: { min: 100, max: 300 },
1125
+ hasCEMCPDirective: true, // Phase 4.3: Simple tool - status check
1126
+ relatedTools: ['get_server_context'],
1127
+ keywords: ['ai', 'status', 'check', 'execution'],
1128
+ requiresAI: false,
1129
+ inputSchema: {
1130
+ type: 'object',
1131
+ properties: {},
1132
+ },
1133
+ });
1134
+ TOOL_CATALOG.set('get_server_context', {
1135
+ name: 'get_server_context',
1136
+ shortDescription: 'Get server context',
1137
+ fullDescription: 'Gets the current server context and configuration.',
1138
+ category: 'utility',
1139
+ complexity: 'simple',
1140
+ tokenCost: { min: 200, max: 500 },
1141
+ hasCEMCPDirective: true, // Phase 4.3: Simple tool - context retrieval
1142
+ relatedTools: ['check_ai_execution_status', 'manage_cache'],
1143
+ keywords: ['server', 'context', 'config', 'status'],
1144
+ requiresAI: false,
1145
+ inputSchema: {
1146
+ type: 'object',
1147
+ properties: {
1148
+ includeConfig: { type: 'boolean', default: false },
1149
+ },
1150
+ },
1151
+ });
1152
+ TOOL_CATALOG.set('get_current_datetime', {
1153
+ name: 'get_current_datetime',
1154
+ shortDescription: 'Get current date/time',
1155
+ fullDescription: 'Gets the current date and time in various formats.',
1156
+ category: 'utility',
1157
+ complexity: 'simple',
1158
+ tokenCost: { min: 50, max: 100 },
1159
+ hasCEMCPDirective: true, // Phase 4.3: Simple tool - datetime retrieval
1160
+ relatedTools: [],
1161
+ keywords: ['datetime', 'time', 'date', 'current'],
1162
+ requiresAI: false,
1163
+ inputSchema: {
1164
+ type: 'object',
1165
+ properties: {
1166
+ format: { type: 'string', enum: ['iso', 'human', 'adr', 'all'] },
1167
+ timezone: { type: 'string' },
1168
+ },
1169
+ },
1170
+ });
1171
+ // CE-MCP Phase 4: Lazy Prompt Loading
1172
+ TOOL_CATALOG.set('load_prompt', {
1173
+ name: 'load_prompt',
1174
+ shortDescription: 'Load prompts on-demand (CE-MCP)',
1175
+ fullDescription: 'Loads prompts on-demand instead of eagerly loading all prompts at startup. Part of CE-MCP lazy loading system that reduces token usage by ~96%.',
1176
+ category: 'utility',
1177
+ complexity: 'simple',
1178
+ tokenCost: { min: 100, max: 500 },
1179
+ hasCEMCPDirective: true,
1180
+ relatedTools: ['search_tools', 'analyze_project_ecosystem'],
1181
+ keywords: ['prompt', 'load', 'lazy', 'ce-mcp', 'token', 'optimization'],
1182
+ requiresAI: false,
1183
+ inputSchema: {
1184
+ type: 'object',
1185
+ properties: {
1186
+ promptName: {
1187
+ type: 'string',
1188
+ description: 'Name of the prompt to load',
1189
+ enum: [
1190
+ 'adr-suggestion',
1191
+ 'deployment-analysis',
1192
+ 'environment-analysis',
1193
+ 'research-question',
1194
+ 'rule-generation',
1195
+ 'analysis',
1196
+ 'research-integration',
1197
+ 'validated-pattern',
1198
+ 'security',
1199
+ ],
1200
+ },
1201
+ section: {
1202
+ type: 'string',
1203
+ description: 'Specific section within the prompt to load',
1204
+ },
1205
+ estimateOnly: {
1206
+ type: 'boolean',
1207
+ description: 'Return only token estimate without loading content',
1208
+ },
1209
+ },
1210
+ required: ['promptName'],
1211
+ },
1212
+ });
1213
+ // ============================================================================
1214
+ // ADR AGGREGATOR INTEGRATION TOOLS
1215
+ // ============================================================================
1216
+ TOOL_CATALOG.set('sync_to_aggregator', {
1217
+ name: 'sync_to_aggregator',
1218
+ shortDescription: 'Sync ADRs to ADR Aggregator platform',
1219
+ fullDescription: 'Syncs Architecture Decision Records to the ADR Aggregator platform (adraggregator.com) for centralized tracking, visualization, and team collaboration. Auto-detects repository from git remote.',
1220
+ category: 'aggregator',
1221
+ complexity: 'moderate',
1222
+ tokenCost: { min: 1000, max: 3000 },
1223
+ hasCEMCPDirective: true,
1224
+ relatedTools: ['get_adr_context', 'get_staleness_report', 'discover_existing_adrs'],
1225
+ keywords: ['aggregator', 'sync', 'adr', 'dashboard', 'platform', 'push'],
1226
+ requiresAI: false,
1227
+ inputSchema: {
1228
+ type: 'object',
1229
+ properties: {
1230
+ full_sync: {
1231
+ type: 'boolean',
1232
+ default: false,
1233
+ description: 'Replace all ADRs instead of incremental sync',
1234
+ },
1235
+ include_metadata: {
1236
+ type: 'boolean',
1237
+ default: true,
1238
+ description: 'Include analysis metadata',
1239
+ },
1240
+ include_diagrams: {
1241
+ type: 'boolean',
1242
+ default: false,
1243
+ description: 'Include Mermaid diagrams (Pro+ tier)',
1244
+ },
1245
+ include_timeline: {
1246
+ type: 'boolean',
1247
+ default: true,
1248
+ description: 'Include timeline/staleness data',
1249
+ },
1250
+ include_security_scan: {
1251
+ type: 'boolean',
1252
+ default: true,
1253
+ description: 'Include security scan results',
1254
+ },
1255
+ include_code_links: {
1256
+ type: 'boolean',
1257
+ default: false,
1258
+ description: 'Include AST-based code links (Pro+ tier)',
1259
+ },
1260
+ adr_paths: {
1261
+ type: 'array',
1262
+ items: { type: 'string' },
1263
+ description: 'Specific ADR paths to sync (optional)',
1264
+ },
1265
+ projectPath: {
1266
+ type: 'string',
1267
+ description: 'Project path (defaults to PROJECT_PATH)',
1268
+ },
1269
+ },
1270
+ },
1271
+ });
1272
+ TOOL_CATALOG.set('get_adr_context', {
1273
+ name: 'get_adr_context',
1274
+ shortDescription: 'Get ADR context from ADR Aggregator',
1275
+ fullDescription: 'Retrieves ADR context, metadata, and analytics from the ADR Aggregator platform for the current repository. Useful for LLM-assisted development with architectural awareness.',
1276
+ category: 'aggregator',
1277
+ complexity: 'simple',
1278
+ tokenCost: { min: 500, max: 1500 },
1279
+ hasCEMCPDirective: true,
1280
+ relatedTools: ['sync_to_aggregator', 'get_staleness_report'],
1281
+ keywords: ['aggregator', 'context', 'adr', 'fetch', 'retrieve', 'pull'],
1282
+ requiresAI: false,
1283
+ inputSchema: {
1284
+ type: 'object',
1285
+ properties: {
1286
+ include_diagrams: {
1287
+ type: 'boolean',
1288
+ default: false,
1289
+ description: 'Include Mermaid diagrams (Pro+ tier)',
1290
+ },
1291
+ include_timeline: {
1292
+ type: 'boolean',
1293
+ default: true,
1294
+ description: 'Include timeline data',
1295
+ },
1296
+ include_code_links: {
1297
+ type: 'boolean',
1298
+ default: false,
1299
+ description: 'Include code links (Pro+ tier)',
1300
+ },
1301
+ include_research: {
1302
+ type: 'boolean',
1303
+ default: false,
1304
+ description: 'Include research context (Pro+ tier)',
1305
+ },
1306
+ staleness_filter: {
1307
+ type: 'string',
1308
+ enum: ['all', 'fresh', 'stale', 'very_stale'],
1309
+ default: 'all',
1310
+ description: 'Filter by staleness level',
1311
+ },
1312
+ graph_depth: {
1313
+ type: 'number',
1314
+ default: 1,
1315
+ description: 'Knowledge graph depth (Team tier)',
1316
+ },
1317
+ projectPath: {
1318
+ type: 'string',
1319
+ description: 'Project path (defaults to PROJECT_PATH)',
1320
+ },
1321
+ },
1322
+ },
1323
+ });
1324
+ TOOL_CATALOG.set('get_staleness_report', {
1325
+ name: 'get_staleness_report',
1326
+ shortDescription: 'Get ADR staleness report from aggregator',
1327
+ fullDescription: 'Retrieves a staleness report showing which ADRs need review based on age and code changes. Helps maintain architectural documentation hygiene.',
1328
+ category: 'aggregator',
1329
+ complexity: 'simple',
1330
+ tokenCost: { min: 300, max: 800 },
1331
+ hasCEMCPDirective: true,
1332
+ relatedTools: ['get_adr_context', 'analyze_adr_timeline'],
1333
+ keywords: ['aggregator', 'staleness', 'report', 'governance', 'review', 'freshness'],
1334
+ requiresAI: false,
1335
+ inputSchema: {
1336
+ type: 'object',
1337
+ properties: {
1338
+ threshold: {
1339
+ type: 'number',
1340
+ default: 90,
1341
+ description: 'Days threshold for staleness',
1342
+ },
1343
+ projectPath: {
1344
+ type: 'string',
1345
+ description: 'Project path (defaults to PROJECT_PATH)',
1346
+ },
1347
+ },
1348
+ },
1349
+ });
1350
+ TOOL_CATALOG.set('get_adr_templates', {
1351
+ name: 'get_adr_templates',
1352
+ shortDescription: 'Get ADR templates from aggregator',
1353
+ fullDescription: 'Retrieves domain-specific ADR templates and best practices from the ADR Aggregator platform. Includes anti-patterns to avoid.',
1354
+ category: 'aggregator',
1355
+ complexity: 'simple',
1356
+ tokenCost: { min: 300, max: 1000 },
1357
+ hasCEMCPDirective: true,
1358
+ relatedTools: ['generate_adr_from_decision', 'suggest_adrs'],
1359
+ keywords: ['aggregator', 'templates', 'best-practices', 'domain', 'anti-patterns'],
1360
+ requiresAI: false,
1361
+ inputSchema: {
1362
+ type: 'object',
1363
+ properties: {
1364
+ domain: {
1365
+ type: 'string',
1366
+ description: 'Domain filter (web_application, microservices, api, etc.)',
1367
+ },
1368
+ },
1369
+ },
1370
+ });
1371
+ TOOL_CATALOG.set('get_adr_diagrams', {
1372
+ name: 'get_adr_diagrams',
1373
+ shortDescription: 'Get Mermaid diagrams from aggregator (Pro+)',
1374
+ fullDescription: 'Retrieves Mermaid diagrams for ADR visualization including workflow, relationships, and impact diagrams. Requires Pro+ tier subscription.',
1375
+ category: 'aggregator',
1376
+ complexity: 'simple',
1377
+ tokenCost: { min: 500, max: 1500 },
1378
+ hasCEMCPDirective: true,
1379
+ relatedTools: ['get_adr_context', 'sync_to_aggregator'],
1380
+ keywords: ['aggregator', 'diagrams', 'mermaid', 'visualization', 'pro', 'tier'],
1381
+ requiresAI: false,
1382
+ inputSchema: {
1383
+ type: 'object',
1384
+ properties: {
1385
+ adr_path: {
1386
+ type: 'string',
1387
+ description: 'Specific ADR path (optional, returns all if not specified)',
1388
+ },
1389
+ projectPath: {
1390
+ type: 'string',
1391
+ description: 'Project path (defaults to PROJECT_PATH)',
1392
+ },
1393
+ },
1394
+ },
1395
+ });
1396
+ TOOL_CATALOG.set('validate_adr_compliance', {
1397
+ name: 'validate_adr_compliance',
1398
+ shortDescription: 'Validate ADR compliance via aggregator (Pro+)',
1399
+ fullDescription: 'Validates that ADRs are properly implemented in code using AST analysis from the ADR Aggregator platform. Requires Pro+ tier subscription.',
1400
+ category: 'aggregator',
1401
+ complexity: 'moderate',
1402
+ tokenCost: { min: 1000, max: 2500 },
1403
+ hasCEMCPDirective: true,
1404
+ relatedTools: ['get_adr_context', 'deployment_readiness'],
1405
+ keywords: ['aggregator', 'compliance', 'validation', 'ast', 'pro', 'tier', 'implementation'],
1406
+ requiresAI: false,
1407
+ inputSchema: {
1408
+ type: 'object',
1409
+ properties: {
1410
+ adr_paths: {
1411
+ type: 'array',
1412
+ items: { type: 'string' },
1413
+ description: 'Specific ADR paths to validate',
1414
+ },
1415
+ validation_type: {
1416
+ type: 'string',
1417
+ enum: ['implementation', 'architecture', 'security', 'all'],
1418
+ default: 'all',
1419
+ description: 'Type of validation to perform',
1420
+ },
1421
+ projectPath: {
1422
+ type: 'string',
1423
+ description: 'Project path (defaults to PROJECT_PATH)',
1424
+ },
1425
+ },
1426
+ },
1427
+ });
1428
+ TOOL_CATALOG.set('get_knowledge_graph', {
1429
+ name: 'get_knowledge_graph',
1430
+ shortDescription: 'Get knowledge graph from aggregator (Team)',
1431
+ fullDescription: 'Retrieves the organizational knowledge graph showing relationships between ADRs, code, patterns, and technologies across repositories. Requires Team tier subscription.',
1432
+ category: 'aggregator',
1433
+ complexity: 'moderate',
1434
+ tokenCost: { min: 1000, max: 3000 },
1435
+ hasCEMCPDirective: true,
1436
+ relatedTools: ['get_architectural_context', 'get_adr_context'],
1437
+ keywords: [
1438
+ 'aggregator',
1439
+ 'knowledge-graph',
1440
+ 'relationships',
1441
+ 'team',
1442
+ 'organization',
1443
+ 'cross-repo',
1444
+ ],
1445
+ requiresAI: false,
1446
+ inputSchema: {
1447
+ type: 'object',
1448
+ properties: {
1449
+ scope: {
1450
+ type: 'string',
1451
+ enum: ['repository', 'organization'],
1452
+ default: 'repository',
1453
+ description: 'Scope of the knowledge graph',
1454
+ },
1455
+ include_analytics: {
1456
+ type: 'boolean',
1457
+ default: true,
1458
+ description: 'Include graph analytics and insights',
1459
+ },
1460
+ projectPath: {
1461
+ type: 'string',
1462
+ description: 'Project path (defaults to PROJECT_PATH)',
1463
+ },
1464
+ },
1465
+ },
1466
+ });
1467
+ TOOL_CATALOG.set('update_implementation_status', {
1468
+ name: 'update_implementation_status',
1469
+ shortDescription: 'Update ADR implementation status (Pro+)',
1470
+ fullDescription: 'Update the implementation status of synced ADRs directly from the IDE. Supports statuses: not_started, in_progress, implemented, deprecated, blocked. Requires Pro+ tier subscription.',
1471
+ category: 'aggregator',
1472
+ complexity: 'simple',
1473
+ tokenCost: { min: 300, max: 800 },
1474
+ hasCEMCPDirective: true,
1475
+ relatedTools: ['sync_to_aggregator', 'get_adr_context', 'validate_adr_compliance'],
1476
+ keywords: [
1477
+ 'aggregator',
1478
+ 'implementation',
1479
+ 'status',
1480
+ 'update',
1481
+ 'pro',
1482
+ 'tier',
1483
+ 'tracking',
1484
+ 'progress',
1485
+ ],
1486
+ requiresAI: false,
1487
+ inputSchema: {
1488
+ type: 'object',
1489
+ properties: {
1490
+ updates: {
1491
+ type: 'array',
1492
+ items: {
1493
+ type: 'object',
1494
+ properties: {
1495
+ adr_path: {
1496
+ type: 'string',
1497
+ description: 'Path to the ADR file relative to project root',
1498
+ },
1499
+ implementation_status: {
1500
+ type: 'string',
1501
+ enum: ['not_started', 'in_progress', 'implemented', 'deprecated', 'blocked'],
1502
+ description: 'New implementation status',
1503
+ },
1504
+ notes: {
1505
+ type: 'string',
1506
+ description: 'Optional notes about the status change',
1507
+ },
1508
+ },
1509
+ required: ['adr_path', 'implementation_status'],
1510
+ },
1511
+ description: 'Array of ADR status updates to apply',
1512
+ },
1513
+ projectPath: {
1514
+ type: 'string',
1515
+ description: 'Project path (defaults to PROJECT_PATH)',
1516
+ },
1517
+ },
1518
+ required: ['updates'],
1519
+ },
1520
+ });
1521
+ TOOL_CATALOG.set('get_adr_priorities', {
1522
+ name: 'get_adr_priorities',
1523
+ shortDescription: 'Get ADR priorities for roadmap/backlog planning',
1524
+ fullDescription: 'Get ADR priorities for roadmap and backlog planning from ADR Aggregator. Returns prioritized ADRs with scores, dependencies, blockers, implementation status, and gap counts.',
1525
+ category: 'aggregator',
1526
+ complexity: 'simple',
1527
+ tokenCost: { min: 500, max: 1500 },
1528
+ hasCEMCPDirective: true,
1529
+ relatedTools: ['get_adr_context', 'update_implementation_status', 'analyze_gaps'],
1530
+ keywords: ['aggregator', 'priorities', 'roadmap', 'backlog', 'planning', 'score', 'dependencies'],
1531
+ requiresAI: false,
1532
+ inputSchema: {
1533
+ type: 'object',
1534
+ properties: {
1535
+ include_ai: {
1536
+ type: 'boolean',
1537
+ description: 'Include AI-based priority recommendations',
1538
+ default: false,
1539
+ },
1540
+ projectPath: {
1541
+ type: 'string',
1542
+ description: 'Project path (defaults to PROJECT_PATH)',
1543
+ },
1544
+ },
1545
+ },
1546
+ });
1547
+ // Aggregator Tool: analyze_gaps
1548
+ TOOL_CATALOG.set('analyze_gaps', {
1549
+ name: 'analyze_gaps',
1550
+ shortDescription: 'Analyze gaps between ADRs and codebase',
1551
+ fullDescription: "Scans local codebase and compares with ADRs to detect bi-directional gaps. Detects ADR-to-code gaps (file references that don't exist) and code-to-ADR gaps (technologies/patterns without ADR coverage).",
1552
+ category: 'aggregator',
1553
+ complexity: 'moderate',
1554
+ tokenCost: { min: 800, max: 3000 },
1555
+ hasCEMCPDirective: true,
1556
+ relatedTools: ['get_adr_priorities', 'get_adr_context', 'suggest_adrs'],
1557
+ keywords: [
1558
+ 'gaps',
1559
+ 'analysis',
1560
+ 'adr',
1561
+ 'codebase',
1562
+ 'coverage',
1563
+ 'technologies',
1564
+ 'patterns',
1565
+ 'aggregator',
1566
+ ],
1567
+ requiresAI: false,
1568
+ inputSchema: {
1569
+ type: 'object',
1570
+ properties: {
1571
+ projectPath: {
1572
+ type: 'string',
1573
+ description: 'Project path (defaults to PROJECT_PATH)',
1574
+ },
1575
+ reportToAggregator: {
1576
+ type: 'boolean',
1577
+ description: 'Whether to report gaps to ADR Aggregator',
1578
+ default: true,
1579
+ },
1580
+ includeDismissed: {
1581
+ type: 'boolean',
1582
+ description: 'Include dismissed gaps in analysis',
1583
+ default: false,
1584
+ },
1585
+ scanDirectories: {
1586
+ type: 'array',
1587
+ items: { type: 'string' },
1588
+ description: 'Specific directories to scan (defaults to common source directories)',
1589
+ },
1590
+ },
1591
+ },
1592
+ });
1593
+ // CE-MCP Meta-Tool: search_tools
1594
+ TOOL_CATALOG.set('search_tools', {
1595
+ name: 'search_tools',
1596
+ shortDescription: 'Search and discover tools (CE-MCP)',
1597
+ fullDescription: 'Search and discover available tools by category, keyword, or capability. Returns lightweight tool metadata for token-efficient discovery.',
1598
+ category: 'utility',
1599
+ complexity: 'simple',
1600
+ tokenCost: { min: 100, max: 300 },
1601
+ hasCEMCPDirective: true,
1602
+ relatedTools: ['load_prompt'],
1603
+ keywords: ['search', 'discover', 'tools', 'catalog', 'ce-mcp', 'meta'],
1604
+ requiresAI: false,
1605
+ inputSchema: {
1606
+ type: 'object',
1607
+ properties: {
1608
+ category: {
1609
+ type: 'string',
1610
+ description: 'Filter by tool category',
1611
+ enum: [
1612
+ 'analysis',
1613
+ 'adr',
1614
+ 'aggregator',
1615
+ 'content-security',
1616
+ 'research',
1617
+ 'deployment',
1618
+ 'memory',
1619
+ 'file-system',
1620
+ 'rules',
1621
+ 'workflow',
1622
+ 'utility',
1623
+ ],
1624
+ },
1625
+ query: {
1626
+ type: 'string',
1627
+ description: 'Search query to match tool names, descriptions, and keywords',
1628
+ },
1629
+ complexity: {
1630
+ type: 'string',
1631
+ enum: ['simple', 'moderate', 'complex'],
1632
+ description: 'Filter by complexity level',
1633
+ },
1634
+ cemcpOnly: {
1635
+ type: 'boolean',
1636
+ description: 'Only return tools with CE-MCP directive support',
1637
+ },
1638
+ limit: {
1639
+ type: 'number',
1640
+ description: 'Maximum number of tools to return',
1641
+ },
1642
+ },
1643
+ },
1644
+ });
1645
+ // ============================================================================
1646
+ // CATALOG HELPER FUNCTIONS
1647
+ // ============================================================================
1648
+ /**
1649
+ * Get catalog entry with computed properties
1650
+ */
1651
+ export function getCatalogEntry(toolName) {
1652
+ const metadata = TOOL_CATALOG.get(toolName);
1653
+ if (!metadata)
1654
+ return undefined;
1655
+ return {
1656
+ ...metadata,
1657
+ isHighTokenCost: metadata.tokenCost.max > 5000,
1658
+ };
1659
+ }
1660
+ /**
1661
+ * Search tools in the catalog
1662
+ */
1663
+ export function searchTools(options = {}) {
1664
+ const { category, query, complexity, cemcpOnly, limit = 20, includeSchema = false } = options;
1665
+ let results = [];
1666
+ // Convert map to array and apply filters
1667
+ for (const [_name, metadata] of TOOL_CATALOG) {
1668
+ // Apply category filter
1669
+ if (category && metadata.category !== category)
1670
+ continue;
1671
+ // Apply complexity filter
1672
+ if (complexity && metadata.complexity !== complexity)
1673
+ continue;
1674
+ // Apply CE-MCP filter
1675
+ if (cemcpOnly && !metadata.hasCEMCPDirective)
1676
+ continue;
1677
+ // Create catalog entry
1678
+ const entry = {
1679
+ ...metadata,
1680
+ isHighTokenCost: metadata.tokenCost.max > 5000,
1681
+ };
1682
+ // Apply query filter with scoring
1683
+ if (query) {
1684
+ const lowerQuery = query.toLowerCase();
1685
+ let score = 0;
1686
+ // Name match (highest priority)
1687
+ if (metadata.name.toLowerCase().includes(lowerQuery)) {
1688
+ score += 100;
1689
+ }
1690
+ // Keyword match
1691
+ for (const keyword of metadata.keywords) {
1692
+ if (keyword.toLowerCase().includes(lowerQuery)) {
1693
+ score += 50;
1694
+ }
1695
+ }
1696
+ // Description match
1697
+ if (metadata.shortDescription.toLowerCase().includes(lowerQuery)) {
1698
+ score += 25;
1699
+ }
1700
+ if (metadata.fullDescription.toLowerCase().includes(lowerQuery)) {
1701
+ score += 10;
1702
+ }
1703
+ if (score === 0)
1704
+ continue;
1705
+ entry.searchScore = score;
1706
+ }
1707
+ // Remove schema if not requested (token savings)
1708
+ if (!includeSchema) {
1709
+ // Create a copy without inputSchema for lighter response
1710
+ const lightEntry = { ...entry };
1711
+ delete lightEntry['inputSchema'];
1712
+ results.push(lightEntry);
1713
+ }
1714
+ else {
1715
+ results.push(entry);
1716
+ }
1717
+ }
1718
+ // Sort by search score if query provided, otherwise by name
1719
+ if (query) {
1720
+ results.sort((a, b) => (b.searchScore || 0) - (a.searchScore || 0));
1721
+ }
1722
+ else {
1723
+ results.sort((a, b) => a.name.localeCompare(b.name));
1724
+ }
1725
+ // Calculate category counts
1726
+ const categories = {
1727
+ analysis: 0,
1728
+ adr: 0,
1729
+ aggregator: 0,
1730
+ 'content-security': 0,
1731
+ research: 0,
1732
+ deployment: 0,
1733
+ memory: 0,
1734
+ 'file-system': 0,
1735
+ rules: 0,
1736
+ workflow: 0,
1737
+ utility: 0,
1738
+ };
1739
+ for (const entry of results) {
1740
+ categories[entry.category]++;
1741
+ }
1742
+ // Apply limit
1743
+ const totalCount = results.length;
1744
+ if (limit && results.length > limit) {
1745
+ results = results.slice(0, limit);
1746
+ }
1747
+ const result = {
1748
+ tools: results,
1749
+ totalCount,
1750
+ categories,
1751
+ };
1752
+ if (query !== undefined) {
1753
+ result.query = query;
1754
+ }
1755
+ return result;
1756
+ }
1757
+ /**
1758
+ * Get all tools in a category
1759
+ */
1760
+ export function getToolsByCategory(category) {
1761
+ return searchTools({ category, limit: 100 }).tools;
1762
+ }
1763
+ /**
1764
+ * Get tools with CE-MCP directives
1765
+ */
1766
+ export function getCEMCPTools() {
1767
+ return searchTools({ cemcpOnly: true, limit: 100 }).tools;
1768
+ }
1769
+ /**
1770
+ * Get high token cost tools (candidates for CE-MCP migration)
1771
+ */
1772
+ export function getHighTokenCostTools() {
1773
+ return searchTools({ limit: 100 }).tools.filter(t => t.isHighTokenCost);
1774
+ }
1775
+ /**
1776
+ * Get catalog summary (for token-efficient listing)
1777
+ */
1778
+ export function getCatalogSummary() {
1779
+ const result = searchTools({ limit: 1000 });
1780
+ return {
1781
+ totalTools: result.totalCount,
1782
+ byCategory: result.categories,
1783
+ cemcpEnabled: getCEMCPTools().length,
1784
+ highTokenCost: getHighTokenCostTools().length,
1785
+ };
1786
+ }
1787
+ /**
1788
+ * Convert catalog entry to MCP Tool format (for ListTools)
1789
+ */
1790
+ export function toMCPTool(entry) {
1791
+ return {
1792
+ name: entry.name,
1793
+ description: entry.fullDescription,
1794
+ inputSchema: entry.inputSchema,
1795
+ };
1796
+ }
1797
+ /**
1798
+ * Get lightweight tool listing (metadata only, no schemas)
1799
+ * Token savings: ~15K → ~5K for full listing
1800
+ */
1801
+ export function getLightweightToolList() {
1802
+ const result = [];
1803
+ for (const [, metadata] of TOOL_CATALOG) {
1804
+ result.push({
1805
+ name: metadata.name,
1806
+ description: metadata.shortDescription,
1807
+ category: metadata.category,
1808
+ hasCEMCPDirective: metadata.hasCEMCPDirective,
1809
+ });
1810
+ }
1811
+ return result.sort((a, b) => a.name.localeCompare(b.name));
1812
+ }
1813
+ //# sourceMappingURL=tool-catalog.js.map