mcp-adr-analysis-server 2.1.19 → 2.1.22

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 (227) hide show
  1. package/README.md +1 -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 +564 -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-bootstrap-validation-tool.d.ts.map +1 -1
  69. package/dist/src/tools/adr-bootstrap-validation-tool.js +7 -6
  70. package/dist/src/tools/adr-bootstrap-validation-tool.js.map +1 -1
  71. package/dist/src/tools/adr-suggestion-tool.d.ts +5 -0
  72. package/dist/src/tools/adr-suggestion-tool.d.ts.map +1 -1
  73. package/dist/src/tools/adr-suggestion-tool.js +40 -71
  74. package/dist/src/tools/adr-suggestion-tool.js.map +1 -1
  75. package/dist/src/tools/bootstrap-validation-loop-tool.d.ts +23 -1
  76. package/dist/src/tools/bootstrap-validation-loop-tool.d.ts.map +1 -1
  77. package/dist/src/tools/bootstrap-validation-loop-tool.js +15 -5
  78. package/dist/src/tools/bootstrap-validation-loop-tool.js.map +1 -1
  79. package/dist/src/tools/ce-mcp-tools.d.ts +291 -0
  80. package/dist/src/tools/ce-mcp-tools.d.ts.map +1 -0
  81. package/dist/src/tools/ce-mcp-tools.js +1188 -0
  82. package/dist/src/tools/ce-mcp-tools.js.map +1 -0
  83. package/dist/src/tools/content-masking-tool.d.ts +11 -0
  84. package/dist/src/tools/content-masking-tool.d.ts.map +1 -1
  85. package/dist/src/tools/content-masking-tool.js +13 -6
  86. package/dist/src/tools/content-masking-tool.js.map +1 -1
  87. package/dist/src/tools/deployment-readiness-tool.d.ts +11 -0
  88. package/dist/src/tools/deployment-readiness-tool.d.ts.map +1 -1
  89. package/dist/src/tools/deployment-readiness-tool.js +10 -4
  90. package/dist/src/tools/deployment-readiness-tool.js.map +1 -1
  91. package/dist/src/tools/environment-analysis-tool.d.ts +96 -1
  92. package/dist/src/tools/environment-analysis-tool.d.ts.map +1 -1
  93. package/dist/src/tools/environment-analysis-tool.js +38 -46
  94. package/dist/src/tools/environment-analysis-tool.js.map +1 -1
  95. package/dist/src/tools/research-question-tool.d.ts.map +1 -1
  96. package/dist/src/tools/research-question-tool.js +3 -2
  97. package/dist/src/tools/research-question-tool.js.map +1 -1
  98. package/dist/src/tools/review-existing-adrs-tool.d.ts +5 -0
  99. package/dist/src/tools/review-existing-adrs-tool.d.ts.map +1 -1
  100. package/dist/src/tools/review-existing-adrs-tool.js +123 -42
  101. package/dist/src/tools/review-existing-adrs-tool.js.map +1 -1
  102. package/dist/src/tools/rule-generation-tool.d.ts.map +1 -1
  103. package/dist/src/tools/rule-generation-tool.js +3 -5
  104. package/dist/src/tools/rule-generation-tool.js.map +1 -1
  105. package/dist/src/tools/search-codebase-tool.d.ts +148 -0
  106. package/dist/src/tools/search-codebase-tool.d.ts.map +1 -0
  107. package/dist/src/tools/search-codebase-tool.js +406 -0
  108. package/dist/src/tools/search-codebase-tool.js.map +1 -0
  109. package/dist/src/tools/smart-git-push-tool-v2.js +1 -1
  110. package/dist/src/tools/smart-git-push-tool-v2.js.map +1 -1
  111. package/dist/src/tools/tool-catalog.d.ts +134 -0
  112. package/dist/src/tools/tool-catalog.d.ts.map +1 -0
  113. package/dist/src/tools/tool-catalog.js +1431 -0
  114. package/dist/src/tools/tool-catalog.js.map +1 -0
  115. package/dist/src/tools/tool-chain-orchestrator.d.ts +11 -2
  116. package/dist/src/tools/tool-chain-orchestrator.d.ts.map +1 -1
  117. package/dist/src/tools/tool-chain-orchestrator.js +11 -2
  118. package/dist/src/tools/tool-chain-orchestrator.js.map +1 -1
  119. package/dist/src/tools/tool-dispatcher.d.ts +98 -0
  120. package/dist/src/tools/tool-dispatcher.d.ts.map +1 -0
  121. package/dist/src/tools/tool-dispatcher.js +225 -0
  122. package/dist/src/tools/tool-dispatcher.js.map +1 -0
  123. package/dist/src/tools/tree-sitter-code-tools.d.ts +184 -0
  124. package/dist/src/tools/tree-sitter-code-tools.d.ts.map +1 -0
  125. package/dist/src/tools/tree-sitter-code-tools.js +642 -0
  126. package/dist/src/tools/tree-sitter-code-tools.js.map +1 -0
  127. package/dist/src/tools/troubleshoot-guided-workflow-tool.d.ts +22 -0
  128. package/dist/src/tools/troubleshoot-guided-workflow-tool.d.ts.map +1 -1
  129. package/dist/src/tools/troubleshoot-guided-workflow-tool.js +20 -3
  130. package/dist/src/tools/troubleshoot-guided-workflow-tool.js.map +1 -1
  131. package/dist/src/tools/update-knowledge-tool.d.ts +89 -0
  132. package/dist/src/tools/update-knowledge-tool.d.ts.map +1 -0
  133. package/dist/src/tools/update-knowledge-tool.js +222 -0
  134. package/dist/src/tools/update-knowledge-tool.js.map +1 -0
  135. package/dist/src/types/ce-mcp.d.ts +248 -0
  136. package/dist/src/types/ce-mcp.d.ts.map +1 -0
  137. package/dist/src/types/ce-mcp.js +27 -0
  138. package/dist/src/types/ce-mcp.js.map +1 -0
  139. package/dist/src/utils/adr-context-detector.js +1 -1
  140. package/dist/src/utils/adr-context-detector.js.map +1 -1
  141. package/dist/src/utils/adr-planning-task-integration.d.ts +260 -0
  142. package/dist/src/utils/adr-planning-task-integration.d.ts.map +1 -0
  143. package/dist/src/utils/adr-planning-task-integration.js +466 -0
  144. package/dist/src/utils/adr-planning-task-integration.js.map +1 -0
  145. package/dist/src/utils/adr-timeline-extractor.d.ts.map +1 -1
  146. package/dist/src/utils/adr-timeline-extractor.js +3 -2
  147. package/dist/src/utils/adr-timeline-extractor.js.map +1 -1
  148. package/dist/src/utils/ai-executor.d.ts +10 -0
  149. package/dist/src/utils/ai-executor.d.ts.map +1 -1
  150. package/dist/src/utils/ai-executor.js +14 -3
  151. package/dist/src/utils/ai-executor.js.map +1 -1
  152. package/dist/src/utils/automatic-prompt-engineering.d.ts +5 -0
  153. package/dist/src/utils/automatic-prompt-engineering.d.ts.map +1 -1
  154. package/dist/src/utils/automatic-prompt-engineering.js +10 -90
  155. package/dist/src/utils/automatic-prompt-engineering.js.map +1 -1
  156. package/dist/src/utils/bootstrap-task-integration.d.ts +214 -0
  157. package/dist/src/utils/bootstrap-task-integration.d.ts.map +1 -0
  158. package/dist/src/utils/bootstrap-task-integration.js +365 -0
  159. package/dist/src/utils/bootstrap-task-integration.js.map +1 -0
  160. package/dist/src/utils/dag-executor.d.ts.map +1 -1
  161. package/dist/src/utils/dag-executor.js +48 -15
  162. package/dist/src/utils/dag-executor.js.map +1 -1
  163. package/dist/src/utils/deployment-task-integration.d.ts +260 -0
  164. package/dist/src/utils/deployment-task-integration.d.ts.map +1 -0
  165. package/dist/src/utils/deployment-task-integration.js +393 -0
  166. package/dist/src/utils/deployment-task-integration.js.map +1 -0
  167. package/dist/src/utils/dynamic-deployment-intelligence.js +1 -1
  168. package/dist/src/utils/dynamic-deployment-intelligence.js.map +1 -1
  169. package/dist/src/utils/enhanced-logging.d.ts +3 -0
  170. package/dist/src/utils/enhanced-logging.d.ts.map +1 -1
  171. package/dist/src/utils/enhanced-logging.js +9 -30
  172. package/dist/src/utils/enhanced-logging.js.map +1 -1
  173. package/dist/src/utils/environment-capability-registry.js +1 -1
  174. package/dist/src/utils/environment-capability-registry.js.map +1 -1
  175. package/dist/src/utils/file-system.d.ts.map +1 -1
  176. package/dist/src/utils/file-system.js +33 -3
  177. package/dist/src/utils/file-system.js.map +1 -1
  178. package/dist/src/utils/gitleaks-detector.js +1 -1
  179. package/dist/src/utils/gitleaks-detector.js.map +1 -1
  180. package/dist/src/utils/knowledge-graph-manager.d.ts +13 -0
  181. package/dist/src/utils/knowledge-graph-manager.d.ts.map +1 -1
  182. package/dist/src/utils/knowledge-graph-manager.js +13 -0
  183. package/dist/src/utils/knowledge-graph-manager.js.map +1 -1
  184. package/dist/src/utils/prompt-execution.d.ts +29 -1
  185. package/dist/src/utils/prompt-execution.d.ts.map +1 -1
  186. package/dist/src/utils/prompt-execution.js +29 -1
  187. package/dist/src/utils/prompt-execution.js.map +1 -1
  188. package/dist/src/utils/research-orchestrator.d.ts +87 -1
  189. package/dist/src/utils/research-orchestrator.d.ts.map +1 -1
  190. package/dist/src/utils/research-orchestrator.js +121 -17
  191. package/dist/src/utils/research-orchestrator.js.map +1 -1
  192. package/dist/src/utils/research-task-integration.d.ts +297 -0
  193. package/dist/src/utils/research-task-integration.d.ts.map +1 -0
  194. package/dist/src/utils/research-task-integration.js +449 -0
  195. package/dist/src/utils/research-task-integration.js.map +1 -0
  196. package/dist/src/utils/ripgrep-wrapper.d.ts.map +1 -1
  197. package/dist/src/utils/ripgrep-wrapper.js +17 -3
  198. package/dist/src/utils/ripgrep-wrapper.js.map +1 -1
  199. package/dist/src/utils/sandbox-executor.d.ts +145 -0
  200. package/dist/src/utils/sandbox-executor.d.ts.map +1 -0
  201. package/dist/src/utils/sandbox-executor.js +642 -0
  202. package/dist/src/utils/sandbox-executor.js.map +1 -0
  203. package/dist/src/utils/server-context-generator.d.ts +5 -0
  204. package/dist/src/utils/server-context-generator.d.ts.map +1 -1
  205. package/dist/src/utils/server-context-generator.js +38 -0
  206. package/dist/src/utils/server-context-generator.js.map +1 -1
  207. package/dist/src/utils/task-manager.d.ts +239 -0
  208. package/dist/src/utils/task-manager.d.ts.map +1 -0
  209. package/dist/src/utils/task-manager.js +528 -0
  210. package/dist/src/utils/task-manager.js.map +1 -0
  211. package/dist/src/utils/task-persistence.d.ts +82 -0
  212. package/dist/src/utils/task-persistence.d.ts.map +1 -0
  213. package/dist/src/utils/task-persistence.js +248 -0
  214. package/dist/src/utils/task-persistence.js.map +1 -0
  215. package/dist/src/utils/test-aware-defaults.d.ts +57 -0
  216. package/dist/src/utils/test-aware-defaults.d.ts.map +1 -0
  217. package/dist/src/utils/test-aware-defaults.js +71 -0
  218. package/dist/src/utils/test-aware-defaults.js.map +1 -0
  219. package/dist/src/utils/tree-sitter-analyzer.d.ts +42 -5
  220. package/dist/src/utils/tree-sitter-analyzer.d.ts.map +1 -1
  221. package/dist/src/utils/tree-sitter-analyzer.js +499 -17
  222. package/dist/src/utils/tree-sitter-analyzer.js.map +1 -1
  223. package/package.json +25 -20
  224. package/dist/src/tools/smart-git-push-tool.d.ts +0 -55
  225. package/dist/src/tools/smart-git-push-tool.d.ts.map +0 -1
  226. package/dist/src/tools/smart-git-push-tool.js +0 -1011
  227. package/dist/src/tools/smart-git-push-tool.js.map +0 -1
@@ -0,0 +1,1431 @@
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
+ // CE-MCP Meta-Tool: search_tools
1214
+ TOOL_CATALOG.set('search_tools', {
1215
+ name: 'search_tools',
1216
+ shortDescription: 'Search and discover tools (CE-MCP)',
1217
+ fullDescription: 'Search and discover available tools by category, keyword, or capability. Returns lightweight tool metadata for token-efficient discovery.',
1218
+ category: 'utility',
1219
+ complexity: 'simple',
1220
+ tokenCost: { min: 100, max: 300 },
1221
+ hasCEMCPDirective: true,
1222
+ relatedTools: ['load_prompt'],
1223
+ keywords: ['search', 'discover', 'tools', 'catalog', 'ce-mcp', 'meta'],
1224
+ requiresAI: false,
1225
+ inputSchema: {
1226
+ type: 'object',
1227
+ properties: {
1228
+ category: {
1229
+ type: 'string',
1230
+ description: 'Filter by tool category',
1231
+ enum: [
1232
+ 'analysis',
1233
+ 'adr',
1234
+ 'content-security',
1235
+ 'research',
1236
+ 'deployment',
1237
+ 'memory',
1238
+ 'file-system',
1239
+ 'rules',
1240
+ 'workflow',
1241
+ 'utility',
1242
+ ],
1243
+ },
1244
+ query: {
1245
+ type: 'string',
1246
+ description: 'Search query to match tool names, descriptions, and keywords',
1247
+ },
1248
+ complexity: {
1249
+ type: 'string',
1250
+ enum: ['simple', 'moderate', 'complex'],
1251
+ description: 'Filter by complexity level',
1252
+ },
1253
+ cemcpOnly: {
1254
+ type: 'boolean',
1255
+ description: 'Only return tools with CE-MCP directive support',
1256
+ },
1257
+ limit: {
1258
+ type: 'number',
1259
+ description: 'Maximum number of tools to return',
1260
+ },
1261
+ },
1262
+ },
1263
+ });
1264
+ // ============================================================================
1265
+ // CATALOG HELPER FUNCTIONS
1266
+ // ============================================================================
1267
+ /**
1268
+ * Get catalog entry with computed properties
1269
+ */
1270
+ export function getCatalogEntry(toolName) {
1271
+ const metadata = TOOL_CATALOG.get(toolName);
1272
+ if (!metadata)
1273
+ return undefined;
1274
+ return {
1275
+ ...metadata,
1276
+ isHighTokenCost: metadata.tokenCost.max > 5000,
1277
+ };
1278
+ }
1279
+ /**
1280
+ * Search tools in the catalog
1281
+ */
1282
+ export function searchTools(options = {}) {
1283
+ const { category, query, complexity, cemcpOnly, limit = 20, includeSchema = false } = options;
1284
+ let results = [];
1285
+ // Convert map to array and apply filters
1286
+ for (const [_name, metadata] of TOOL_CATALOG) {
1287
+ // Apply category filter
1288
+ if (category && metadata.category !== category)
1289
+ continue;
1290
+ // Apply complexity filter
1291
+ if (complexity && metadata.complexity !== complexity)
1292
+ continue;
1293
+ // Apply CE-MCP filter
1294
+ if (cemcpOnly && !metadata.hasCEMCPDirective)
1295
+ continue;
1296
+ // Create catalog entry
1297
+ const entry = {
1298
+ ...metadata,
1299
+ isHighTokenCost: metadata.tokenCost.max > 5000,
1300
+ };
1301
+ // Apply query filter with scoring
1302
+ if (query) {
1303
+ const lowerQuery = query.toLowerCase();
1304
+ let score = 0;
1305
+ // Name match (highest priority)
1306
+ if (metadata.name.toLowerCase().includes(lowerQuery)) {
1307
+ score += 100;
1308
+ }
1309
+ // Keyword match
1310
+ for (const keyword of metadata.keywords) {
1311
+ if (keyword.toLowerCase().includes(lowerQuery)) {
1312
+ score += 50;
1313
+ }
1314
+ }
1315
+ // Description match
1316
+ if (metadata.shortDescription.toLowerCase().includes(lowerQuery)) {
1317
+ score += 25;
1318
+ }
1319
+ if (metadata.fullDescription.toLowerCase().includes(lowerQuery)) {
1320
+ score += 10;
1321
+ }
1322
+ if (score === 0)
1323
+ continue;
1324
+ entry.searchScore = score;
1325
+ }
1326
+ // Remove schema if not requested (token savings)
1327
+ if (!includeSchema) {
1328
+ // Create a copy without inputSchema for lighter response
1329
+ const lightEntry = { ...entry };
1330
+ delete lightEntry['inputSchema'];
1331
+ results.push(lightEntry);
1332
+ }
1333
+ else {
1334
+ results.push(entry);
1335
+ }
1336
+ }
1337
+ // Sort by search score if query provided, otherwise by name
1338
+ if (query) {
1339
+ results.sort((a, b) => (b.searchScore || 0) - (a.searchScore || 0));
1340
+ }
1341
+ else {
1342
+ results.sort((a, b) => a.name.localeCompare(b.name));
1343
+ }
1344
+ // Calculate category counts
1345
+ const categories = {
1346
+ analysis: 0,
1347
+ adr: 0,
1348
+ 'content-security': 0,
1349
+ research: 0,
1350
+ deployment: 0,
1351
+ memory: 0,
1352
+ 'file-system': 0,
1353
+ rules: 0,
1354
+ workflow: 0,
1355
+ utility: 0,
1356
+ };
1357
+ for (const entry of results) {
1358
+ categories[entry.category]++;
1359
+ }
1360
+ // Apply limit
1361
+ const totalCount = results.length;
1362
+ if (limit && results.length > limit) {
1363
+ results = results.slice(0, limit);
1364
+ }
1365
+ const result = {
1366
+ tools: results,
1367
+ totalCount,
1368
+ categories,
1369
+ };
1370
+ if (query !== undefined) {
1371
+ result.query = query;
1372
+ }
1373
+ return result;
1374
+ }
1375
+ /**
1376
+ * Get all tools in a category
1377
+ */
1378
+ export function getToolsByCategory(category) {
1379
+ return searchTools({ category, limit: 100 }).tools;
1380
+ }
1381
+ /**
1382
+ * Get tools with CE-MCP directives
1383
+ */
1384
+ export function getCEMCPTools() {
1385
+ return searchTools({ cemcpOnly: true, limit: 100 }).tools;
1386
+ }
1387
+ /**
1388
+ * Get high token cost tools (candidates for CE-MCP migration)
1389
+ */
1390
+ export function getHighTokenCostTools() {
1391
+ return searchTools({ limit: 100 }).tools.filter(t => t.isHighTokenCost);
1392
+ }
1393
+ /**
1394
+ * Get catalog summary (for token-efficient listing)
1395
+ */
1396
+ export function getCatalogSummary() {
1397
+ const result = searchTools({ limit: 1000 });
1398
+ return {
1399
+ totalTools: result.totalCount,
1400
+ byCategory: result.categories,
1401
+ cemcpEnabled: getCEMCPTools().length,
1402
+ highTokenCost: getHighTokenCostTools().length,
1403
+ };
1404
+ }
1405
+ /**
1406
+ * Convert catalog entry to MCP Tool format (for ListTools)
1407
+ */
1408
+ export function toMCPTool(entry) {
1409
+ return {
1410
+ name: entry.name,
1411
+ description: entry.fullDescription,
1412
+ inputSchema: entry.inputSchema,
1413
+ };
1414
+ }
1415
+ /**
1416
+ * Get lightweight tool listing (metadata only, no schemas)
1417
+ * Token savings: ~15K → ~5K for full listing
1418
+ */
1419
+ export function getLightweightToolList() {
1420
+ const result = [];
1421
+ for (const [, metadata] of TOOL_CATALOG) {
1422
+ result.push({
1423
+ name: metadata.name,
1424
+ description: metadata.shortDescription,
1425
+ category: metadata.category,
1426
+ hasCEMCPDirective: metadata.hasCEMCPDirective,
1427
+ });
1428
+ }
1429
+ return result.sort((a, b) => a.name.localeCompare(b.name));
1430
+ }
1431
+ //# sourceMappingURL=tool-catalog.js.map