cross_system_impact
Analyze the impact of code changes across distributed systems using Gemini AI. Identify breaking, performance, and behavioral effects by specifying files and services for comprehensive cross-boundary debugging.
Instructions
Use Gemini to analyze changes across service boundaries
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| change_scope | Yes | ||
| impact_types | No |
Implementation Reference
- Core handler function that performs the cross-system impact analysis: reads changed files and related service files (Services, Controllers, Clients), gathers code content, and delegates to Gemini service for analysis.async analyzeCrossSystemImpact( changeScope: string[], impactTypes?: string[], ): Promise<{ analysis: string; filesAnalyzed: string[]; impactTypes: string[]; }> { const codeFiles = new Map<string, string>(); // Read all files in change scope for (const file of changeScope) { try { const content = await this.codeReader.readFile(file); codeFiles.set(file, content); // Also read related service files const relatedFiles = await this.codeReader.findRelatedFiles(file, ['Service', 'Controller', 'Client']); for (const related of relatedFiles) { const relatedContent = await this.codeReader.readFile(related); codeFiles.set(related, relatedContent); } } catch (error) { console.error(`Failed to read ${file}:`, error); } } // Use Gemini for cross-system analysis const analysis = await this.geminiService.performCrossSystemAnalysis( codeFiles, changeScope, ); return { analysis, filesAnalyzed: Array.from(codeFiles.keys()), impactTypes: impactTypes || ['breaking', 'performance', 'behavioral'], }; }
- src/index.ts:77-83 (schema)Zod schema defining input validation for the cross_system_impact tool, matching the MCP inputSchema.const CrossSystemImpactSchema = z.object({ change_scope: z.object({ files: z.array(z.string()), service_names: z.array(z.string()).optional(), }), impact_types: z.array(z.enum(['breaking', 'performance', 'behavioral'])).optional(), });
- src/index.ts:256-276 (registration)MCP tool registration in ListTools handler, defining name, description, and inputSchema for cross_system_impact.name: 'cross_system_impact', description: 'Use Gemini to analyze changes across service boundaries', inputSchema: { type: 'object', properties: { change_scope: { type: 'object', properties: { files: { type: 'array', items: { type: 'string' } }, service_names: { type: 'array', items: { type: 'string' } }, }, required: ['files'], }, impact_types: { type: 'array', items: { type: 'string', enum: ['breaking', 'performance', 'behavioral'] }, }, }, required: ['change_scope'], }, },
- src/index.ts:594-619 (handler)MCP CallTool request handler case that parses input, validates files, calls the deepReasoner handler, and formats response.case 'cross_system_impact': { const parsed = CrossSystemImpactSchema.parse(args); // Validate file paths const validatedFiles = InputValidator.validateFilePaths(parsed.change_scope.files); if (validatedFiles.length === 0) { throw new McpError( ErrorCode.InvalidParams, 'No valid file paths provided', ); } const result = await deepReasoner.analyzeCrossSystemImpact( validatedFiles, parsed.impact_types, ); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }