Skip to main content
Glama

CodeCompass MCP

consolidated.ts•21 kB
import { Tool } from '@modelcontextprotocol/sdk/types.js'; /** * Streamlined tool definitions for CodeCompass MCP Server * Rationalized to 12 atomic, composable tools with clear boundaries * Each tool does one thing well with no overlapping responsibilities */ export const consolidatedTools: Tool[] = [ // Core Data Tools (6 tools) { name: 'get_repository_info', description: 'šŸ“Š Get basic repository metadata, statistics, and key information. Atomic tool focused purely on repository-level data without file content analysis.', inputSchema: { type: 'object', properties: { url: { type: 'string', description: 'GitHub repository URL (e.g., https://github.com/owner/repo)', }, options: { type: 'object', properties: { include_stats: { type: 'boolean', description: 'Include repository statistics (stars, forks, etc.)', default: true, }, include_languages: { type: 'boolean', description: 'Include language breakdown', default: true, }, include_topics: { type: 'boolean', description: 'Include repository topics and tags', default: true, }, }, }, }, required: ['url'], }, }, { name: 'get_file_tree', description: '🌳 Get complete directory structure and file listing with filtering options. Focused on file system structure without content analysis.', inputSchema: { type: 'object', properties: { url: { type: 'string', description: 'GitHub repository URL', }, options: { type: 'object', properties: { max_depth: { type: 'number', description: 'Maximum directory depth to traverse', default: 10, }, include_hidden: { type: 'boolean', description: 'Include hidden files and directories', default: false, }, file_extensions: { type: 'array', items: { type: 'string' }, description: 'Filter by file extensions (e.g., [".js", ".ts"])', }, exclude_paths: { type: 'array', items: { type: 'string' }, description: 'Paths to exclude from listing', default: ['node_modules', 'dist', 'build', '.git'], }, include_file_info: { type: 'boolean', description: 'Include file metadata (size, modified date)', default: true, }, }, }, }, required: ['url'], }, }, { name: 'search_repository', description: 'Search for patterns, text, functions, or classes across the entire repository with advanced filtering options.', inputSchema: { type: 'object', properties: { url: { type: 'string', description: 'GitHub repository URL', }, query: { type: 'string', description: 'Search query (supports regex patterns)', }, search_type: { type: 'string', enum: ['text', 'regex', 'function', 'class', 'variable', 'import'], description: 'Type of search to perform', default: 'text', }, options: { type: 'object', properties: { case_sensitive: { type: 'boolean', description: 'Case sensitive search', default: false, }, file_extensions: { type: 'array', items: { type: 'string' }, description: 'File extensions to search in', }, exclude_paths: { type: 'array', items: { type: 'string' }, description: 'Paths to exclude from search', default: ['node_modules', 'dist', 'build', '.git'], }, max_results: { type: 'number', description: 'Maximum number of results', default: 100, }, include_context: { type: 'boolean', description: 'Include surrounding code context', default: true, }, }, }, }, required: ['url', 'query'], }, }, { name: 'get_file_content', description: 'šŸ“ Retrieve content of specific files with smart truncation and batch processing capabilities.\n\nāš ļø FEATURES:\n• Batch processing with concurrent file retrieval\n• Automatic file validation and security checks\n• Rich metadata extraction (file type, language, size, line count)\n• Configurable processing limits and error handling\n• Support for multiple file formats with type detection', inputSchema: { type: 'object', properties: { url: { type: 'string', description: 'GitHub repository URL', }, file_paths: { type: 'array', items: { type: 'string' }, description: 'Paths to files to retrieve (supports batch processing)', }, options: { type: 'object', properties: { max_size: { type: 'number', description: 'Maximum file size in bytes', default: 100000, }, include_metadata: { type: 'boolean', description: 'Include file metadata (size, modified date, etc.)', default: false, }, truncate_large_files: { type: 'boolean', description: 'Truncate files larger than max_size', default: true, }, max_concurrent: { type: 'number', description: 'Maximum concurrent file processing', default: 5, minimum: 1, maximum: 20, }, continue_on_error: { type: 'boolean', description: 'Continue processing other files if one fails', default: true, }, file_extensions: { type: 'array', items: { type: 'string' }, description: 'Only process files with these extensions (e.g., [".js", ".ts"])', }, exclude_patterns: { type: 'array', items: { type: 'string' }, description: 'Exclude files matching these regex patterns', }, format: { type: 'string', enum: ['raw', 'parsed', 'summary'], description: 'Format for file content', default: 'raw', }, }, }, }, required: ['url', 'file_paths'], }, }, { name: 'analyze_codebase', description: 'šŸ”¬ Comprehensive codebase analysis combining structure, architecture, and metrics. Provides unified view of code organization, design patterns, complexity, and quality indicators.', inputSchema: { type: 'object', properties: { url: { type: 'string', description: 'GitHub repository URL', }, file_paths: { type: 'array', items: { type: 'string' }, description: 'Specific files to analyze (optional - analyzes all code files if not specified)', }, analysis_types: { type: 'array', items: { type: 'string', enum: ['structure', 'architecture', 'metrics', 'patterns', 'complexity'], }, description: 'Types of analysis to perform', default: ['structure', 'architecture', 'metrics'], }, options: { type: 'object', properties: { include_functions: { type: 'boolean', description: 'Include function analysis', default: true, }, include_classes: { type: 'boolean', description: 'Include class analysis', default: true, }, include_imports: { type: 'boolean', description: 'Include import/dependency analysis', default: true, }, include_complexity: { type: 'boolean', description: 'Include complexity metrics', default: true, }, include_patterns: { type: 'boolean', description: 'Include design pattern detection', default: true, }, include_components: { type: 'boolean', description: 'Include reusable component identification', default: false, }, languages: { type: 'array', items: { type: 'string' }, description: 'Programming languages to analyze', }, confidence_threshold: { type: 'number', description: 'Minimum confidence score for pattern detection', default: 0.7, }, }, }, }, required: ['url'], }, }, { name: 'analyze_dependencies', description: 'šŸ“¦ Comprehensive dependency analysis including external packages, internal dependencies, security vulnerabilities, and version conflicts.', inputSchema: { type: 'object', properties: { url: { type: 'string', description: 'GitHub repository URL', }, options: { type: 'object', properties: { include_dev_dependencies: { type: 'boolean', description: 'Include development dependencies', default: true, }, include_security_scan: { type: 'boolean', description: 'Include security vulnerability scanning', default: true, }, include_version_analysis: { type: 'boolean', description: 'Include version conflict analysis', default: true, }, check_outdated: { type: 'boolean', description: 'Check for outdated packages', default: true, }, }, }, }, required: ['url'], }, }, // AI-Enhanced Tools (3 tools) { name: 'review_code', description: 'šŸ” Comprehensive code review combining AI insights with rule-based validation. Provides intelligent analysis, security scanning, and actionable recommendations.', inputSchema: { type: 'object', properties: { url: { type: 'string', description: 'GitHub repository URL', }, file_paths: { type: 'array', items: { type: 'string' }, description: 'Specific files to review (optional - reviews key files if not specified)', }, review_mode: { type: 'string', enum: ['ai', 'rules', 'combined'], description: 'Review approach: AI-powered, rule-based, or combined', default: 'combined', }, review_focus: { type: 'array', items: { type: 'string', enum: ['security', 'performance', 'maintainability', 'best-practices', 'bugs', 'accessibility'], }, description: 'Areas to focus the review on', default: ['security', 'performance', 'maintainability'], }, options: { type: 'object', properties: { ai_model: { type: 'string', description: 'AI model to use for analysis (OpenRouter models). Use "auto" for intelligent model selection', default: 'auto', }, severity_threshold: { type: 'string', enum: ['low', 'medium', 'high', 'critical'], description: 'Minimum severity level to report', default: 'medium', }, include_fixes: { type: 'boolean', description: 'Include suggested fixes', default: true, }, include_examples: { type: 'boolean', description: 'Include code examples in suggestions', default: true, }, language_specific: { type: 'boolean', description: 'Include language-specific best practices', default: true, }, framework_specific: { type: 'boolean', description: 'Include framework-specific checks', default: true, }, }, }, }, required: ['url'], }, }, { name: 'explain_code', description: 'šŸ“š AI-powered code explanation generating human-readable documentation, tutorials, and architectural insights. Transforms technical analysis into accessible explanations.', inputSchema: { type: 'object', properties: { url: { type: 'string', description: 'GitHub repository URL', }, file_paths: { type: 'array', items: { type: 'string' }, description: 'Specific files to explain (optional - explains key files if not specified)', }, explanation_type: { type: 'string', enum: ['overview', 'detailed', 'architecture', 'tutorial', 'integration'], description: 'Type of explanation to generate', default: 'overview', }, options: { type: 'object', properties: { ai_model: { type: 'string', description: 'AI model to use for explanation (OpenRouter models). Use "auto" for intelligent model selection', default: 'auto', }, target_audience: { type: 'string', enum: ['beginner', 'intermediate', 'advanced'], description: 'Target audience for explanation', default: 'intermediate', }, include_examples: { type: 'boolean', description: 'Include code examples in explanations', default: true, }, include_diagrams: { type: 'boolean', description: 'Include ASCII diagrams where helpful', default: true, }, focus_on_patterns: { type: 'boolean', description: 'Focus on design patterns and architecture', default: true, }, }, }, }, required: ['url'], }, }, { name: 'suggest_improvements', description: 'šŸ’” AI-powered improvement suggestions providing strategic refactoring recommendations, modernization plans, and architectural enhancements.', inputSchema: { type: 'object', properties: { url: { type: 'string', description: 'GitHub repository URL', }, file_paths: { type: 'array', items: { type: 'string' }, description: 'Specific files to analyze for improvements (optional - analyzes key files if not specified)', }, improvement_goals: { type: 'array', items: { type: 'string', enum: ['modernize', 'performance', 'maintainability', 'security', 'readability', 'testability'], }, description: 'Goals for improvement suggestions', default: ['modernize', 'maintainability'], }, target_framework: { type: 'string', description: 'Target framework for improvement suggestions', }, options: { type: 'object', properties: { ai_model: { type: 'string', description: 'AI model to use for suggestions (OpenRouter models). Use "auto" for intelligent model selection', default: 'auto', }, include_code_examples: { type: 'boolean', description: 'Include before/after code examples', default: true, }, priority_level: { type: 'string', enum: ['low', 'medium', 'high'], description: 'Minimum priority level for suggestions', default: 'medium', }, estimate_effort: { type: 'boolean', description: 'Include effort estimates for improvement tasks', default: true, }, }, }, }, required: ['url'], }, }, // Transformation Tools (1 tool) { name: 'transform_code', description: 'šŸ”§ Apply code transformations including syntax changes, structural reorganization, framework migration, and modernization. Combines syntax-level and structural changes.', inputSchema: { type: 'object', properties: { code: { type: 'string', description: 'Source code to transform', }, transformations: { type: 'array', items: { type: 'object', properties: { type: { type: 'string', enum: ['naming', 'modernize', 'framework', 'performance', 'security', 'structure', 'migration'], description: 'Type of transformation', }, options: { type: 'object', description: 'Transformation-specific options', }, }, required: ['type'], }, description: 'List of transformations to apply', }, language: { type: 'string', description: 'Programming language of the code', }, target_language: { type: 'string', description: 'Target language (for language conversion)', }, target_framework: { type: 'string', description: 'Target framework (for framework migration)', }, options: { type: 'object', properties: { preserve_comments: { type: 'boolean', description: 'Preserve code comments', default: true, }, preserve_logic: { type: 'boolean', description: 'Preserve business logic during transformation', default: true, }, update_imports: { type: 'boolean', description: 'Update import paths automatically', default: true, }, include_instructions: { type: 'boolean', description: 'Include transformation instructions', default: true, }, validate_syntax: { type: 'boolean', description: 'Validate syntax after transformation', default: true, }, }, }, }, required: ['code', 'transformations', 'language'], }, }, // Utility Tools (1 tool) { name: 'health_check', description: 'šŸ„ System Health Check - Monitor server health, performance, and operational metrics. Provides comprehensive monitoring dashboard with real-time insights.', inputSchema: { type: 'object', properties: { checks: { type: 'array', items: { type: 'string', enum: ['api-limits', 'system-health', 'monitoring', 'dependencies', 'configuration'], }, description: 'Types of health checks to perform', default: ['api-limits', 'system-health', 'monitoring'], }, options: { type: 'object', properties: { include_metrics: { type: 'boolean', description: 'Include comprehensive system metrics in response', default: false, }, include_insights: { type: 'boolean', description: 'Include performance insights and recommendations', default: false, }, include_logs: { type: 'boolean', description: 'Include recent log entries', default: false, }, include_diagnostics: { type: 'boolean', description: 'Include diagnostic information', default: false, }, }, }, }, required: [], }, }, ];

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/TheAlchemist6/codecompass-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server