@@ -288,28 +288,50 @@ server.registerTool(
288288 "feature_impact_analyzer" ,
289289 {
290290 title : "Feature Integration Impact Analyzer" ,
291- description : "Performs in-depth analysis of hidden impact of feature integration based on GitHub repository URL and PR number." ,
291+ description : `
292+ Takes a GitHub repository URL, Pull Request number, and authentication token as input.
293+ Analyzes the PR’s commits and changed files to compute impact metrics — scale, dispersion,
294+ chaos, isolation, lag, and coupling — and outputs a detailed HTML report highlighting
295+ long-tail file path outliers.
296+ ` . trim ( ) ,
292297 inputSchema : {
293298 repoUrl : z . string ( ) . url ( ) . describe ( "Full URL of GitHub repository to analyze (e.g. https://github.com/owner/repo)" ) ,
294299 prNumber : z . number ( ) . int ( ) . positive ( ) . describe ( "Pull Request number to analyze" ) ,
295300 githubToken : z . string ( ) . describe ( "GitHub authentication token" ) ,
296301 locale : z . enum ( [ "en" , "ko" ] ) . default ( "en" ) . describe ( "Response language (en: English, ko: Korean)" ) ,
302+ isChart : z . boolean ( ) . default ( false ) . describe ( "Return HTML chart (true) or JSON (false, default)" ) ,
297303 } ,
298304 } ,
299305
300- async ( { repoUrl, prNumber, githubToken, locale } : FeatureImpactAnalyzerInputs & { locale ?: string } ) => {
306+ async ( { repoUrl, prNumber, githubToken, locale, isChart } : FeatureImpactAnalyzerInputs & { locale ?: string ; isChart ?: boolean } ) => {
301307 try {
302308 I18n . setLocale ( locale || 'en' ) ;
303- const payload = await analyzeFeatureImpact ( { repoUrl, prNumber, githubToken } ) ;
309+
310+ const { McpReportGenerator } = await import ( "./tool/featureImpactAnalyzer.js" ) ;
311+ const analyzeFeatureImpact = new McpReportGenerator ( { repoUrl, prNumber, githubToken, locale } ) ;
304312
305- return {
306- content : [
307- {
308- type : "text" ,
309- text : JSON . stringify ( payload , null , 2 ) ,
310- } ,
311- ] ,
312- } ;
313+ const payload = await analyzeFeatureImpact . generateWithOutlierRatings ( ) ;
314+
315+ if ( isChart ) {
316+ const chartHtml = analyzeFeatureImpact . generateReport ( payload ) ;
317+ return {
318+ content : [
319+ {
320+ type : "text" ,
321+ text : JSON . stringify ( payload , null , 2 ) + "\n created chart:" + chartHtml
322+ } ,
323+ ] ,
324+ } ;
325+ } else {
326+ return {
327+ content : [
328+ {
329+ type : "text" ,
330+ text : JSON . stringify ( payload , null , 2 ) ,
331+ } ,
332+ ] ,
333+ } ;
334+ }
313335 } catch ( err : any ) {
314336 return {
315337 content : [
0 commit comments