Skip to main content
Glama

compare_integration

Analyze code integration across files to detect mismatches, missing imports, and compatibility issues, providing actionable fixes with line numbers.

Instructions

Compare integration between multiple files to identify mismatches, missing imports, and compatibility issues. Returns actionable fixes with line numbers.

WORKFLOW: Perfect for understanding complex code, identifying issues, and technical debt assessment TIP: Use Desktop Commander to read files, then pass content here for analysis SAVES: Claude context for strategic decisions

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
analysisDepthNoLevel of analysis detaildetailed
analysisTypeNoType of integration analysis to performintegration
codeNoThe code to analyze (for single-file analysis)
filePathNoPath to single file to analyze
filesNoArray of absolute file paths to analyze
focusNoSpecific areas to focus on: method_compatibility, namespace_dependencies, data_flow, missing_connections
languageNoProgramming languagejavascript
maxDepthNoMaximum directory depth for multi-file discovery (1-5)
projectPathNoPath to project root (for multi-file analysis)

Implementation Reference

  • Main handler function that orchestrates the execution of the compare_integration tool, including security wrapping, parameter validation, mode detection (single/multi-file), model setup, and routing to specific analysis methods.
    async execute(params: any, llmClient: any) { return await withSecurity(this, params, llmClient, async (secureParams) => { try { // 1. Auto-detect analysis mode based on parameters const analysisMode = this.detectAnalysisMode(secureParams); // 2. Validate parameters based on detected mode this.validateParameters(secureParams, analysisMode); // 3. Setup model const { model, contextLength } = await ModelSetup.getReadyModel(llmClient); // 4. Route to appropriate analysis method if (analysisMode === 'single-file') { return await this.executeSingleFileAnalysis(secureParams, model, contextLength); } else { return await this.executeMultiFileAnalysis(secureParams, model, contextLength); } } catch (error: any) { return ErrorHandler.createExecutionError('compare_integration', error); } }); }
  • Input schema defining parameters for single-file and multi-file integration comparison analysis.
    parameters = { // Single-file parameters code: { type: 'string' as const, description: 'The code to analyze (for single-file analysis)', required: false }, filePath: { type: 'string' as const, description: 'Path to single file to analyze', required: false }, // Multi-file parameters projectPath: { type: 'string' as const, description: 'Path to project root (for multi-file analysis)', required: false }, files: { type: 'array' as const, description: 'Array of absolute file paths to analyze', required: false, items: { type: 'string' as const } }, maxDepth: { type: 'number' as const, description: 'Maximum directory depth for multi-file discovery (1-5)', required: false, default: 3 }, // Universal parameters language: { type: 'string' as const, description: 'Programming language', required: false, default: 'javascript' }, analysisDepth: { type: 'string' as const, description: 'Level of analysis detail', enum: ['basic', 'detailed', 'comprehensive'], default: 'detailed', required: false }, analysisType: { type: 'string' as const, description: 'Type of integration analysis to perform', enum: ['integration', 'compatibility', 'dependencies'], default: 'integration', required: false }, focus: { type: 'array' as const, description: 'Specific areas to focus on: method_compatibility, namespace_dependencies, data_flow, missing_connections', required: false, default: [], items: { type: 'string' as const } } };
  • Tool name registration within the IntegrationComparator class.
    name = 'compare_integration';
  • Output schema defining the structure of the response from the compare_integration tool.
    export interface CompareIntegrationResponse extends BaseResponse { data: { summary: { filesAnalyzed: number; issuesFound: number; compatibilityScore: number; }; integrationIssues: Array<{ type: string; severity: "critical" | "high" | "medium" | "low"; files: Array<{ path: string; line: number; code?: string; }>; description: string; fix: { description: string; code?: string; automated: boolean; }; }>; dependencies: { graph: { [file: string]: string[] }; circular: Array<string[]>; missing: Array<{ file: string; importName: string; }>; }; suggestions: string[]; }; }
  • Response type registration in the central FunctionResponseMap.
    'compare_integration': CompareIntegrationResponse;

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/houtini-ai/lm'

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