hawkeye-mcp-server 1.0.0
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.
- package/CHANGELOG.md +123 -0
- package/INSTALLATION.md +734 -0
- package/LICENSE +21 -0
- package/README.md +289 -0
- package/SPECIFICATION.md +1073 -0
- package/USAGE.md +849 -0
- package/build/config/config.d.ts +58 -0
- package/build/config/config.js +100 -0
- package/build/config/config.js.map +1 -0
- package/build/index.d.ts +6 -0
- package/build/index.js +138 -0
- package/build/index.js.map +1 -0
- package/build/services/auth.service.d.ts +34 -0
- package/build/services/auth.service.js +96 -0
- package/build/services/auth.service.js.map +1 -0
- package/build/services/project.service.d.ts +50 -0
- package/build/services/project.service.js +136 -0
- package/build/services/project.service.js.map +1 -0
- package/build/services/session.service.d.ts +68 -0
- package/build/services/session.service.js +357 -0
- package/build/services/session.service.js.map +1 -0
- package/build/tools/continue-investigation.d.ts +10 -0
- package/build/tools/continue-investigation.js +84 -0
- package/build/tools/continue-investigation.js.map +1 -0
- package/build/tools/get-incident-report.d.ts +10 -0
- package/build/tools/get-incident-report.js +62 -0
- package/build/tools/get-incident-report.js.map +1 -0
- package/build/tools/get-session-report.d.ts +25 -0
- package/build/tools/get-session-report.js +46 -0
- package/build/tools/get-session-report.js.map +1 -0
- package/build/tools/get-session-summary.d.ts +22 -0
- package/build/tools/get-session-summary.js +41 -0
- package/build/tools/get-session-summary.js.map +1 -0
- package/build/tools/get-status.d.ts +10 -0
- package/build/tools/get-status.js +129 -0
- package/build/tools/get-status.js.map +1 -0
- package/build/tools/index.d.ts +29 -0
- package/build/tools/index.js +349 -0
- package/build/tools/index.js.map +1 -0
- package/build/tools/inspect-session.d.ts +28 -0
- package/build/tools/inspect-session.js +51 -0
- package/build/tools/inspect-session.js.map +1 -0
- package/build/tools/investigate-alert.d.ts +10 -0
- package/build/tools/investigate-alert.js +122 -0
- package/build/tools/investigate-alert.js.map +1 -0
- package/build/tools/list-sessions.d.ts +49 -0
- package/build/tools/list-sessions.js +79 -0
- package/build/tools/list-sessions.js.map +1 -0
- package/build/types/errors.d.ts +61 -0
- package/build/types/errors.js +76 -0
- package/build/types/errors.js.map +1 -0
- package/build/types/hawkeye.d.ts +238 -0
- package/build/types/hawkeye.js +8 -0
- package/build/types/hawkeye.js.map +1 -0
- package/build/types/mcp.d.ts +125 -0
- package/build/types/mcp.js +6 -0
- package/build/types/mcp.js.map +1 -0
- package/build/utils/errors.d.ts +20 -0
- package/build/utils/errors.js +125 -0
- package/build/utils/errors.js.map +1 -0
- package/build/utils/http-client.d.ts +51 -0
- package/build/utils/http-client.js +133 -0
- package/build/utils/http-client.js.map +1 -0
- package/build/utils/logger.d.ts +35 -0
- package/build/utils/logger.js +77 -0
- package/build/utils/logger.js.map +1 -0
- package/build/utils/validation.d.ts +134 -0
- package/build/utils/validation.js +68 -0
- package/build/utils/validation.js.map +1 -0
- package/package.json +66 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool: hawkeye_get_session_report
|
|
3
|
+
* Gets summary reports for one or more sessions with time-saved metrics
|
|
4
|
+
*/
|
|
5
|
+
import { logger } from '../utils/logger.js';
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
/**
|
|
8
|
+
* Input validation schema
|
|
9
|
+
*/
|
|
10
|
+
const GetSessionReportInputSchema = z.object({
|
|
11
|
+
session_uuids: z.array(z.string()).min(1),
|
|
12
|
+
project_uuid: z.string(),
|
|
13
|
+
});
|
|
14
|
+
/**
|
|
15
|
+
* Get session reports with summaries and metrics
|
|
16
|
+
*/
|
|
17
|
+
export async function getSessionReport(services, args) {
|
|
18
|
+
const input = GetSessionReportInputSchema.parse(args);
|
|
19
|
+
logger.info('Getting session reports', {
|
|
20
|
+
sessionUuids: input.session_uuids,
|
|
21
|
+
projectUuid: input.project_uuid
|
|
22
|
+
});
|
|
23
|
+
// Get session reports
|
|
24
|
+
const reports = await services.sessionService.getSessionReport(input.session_uuids, input.project_uuid);
|
|
25
|
+
logger.info(`Retrieved ${reports.length} session reports`);
|
|
26
|
+
// Calculate totals
|
|
27
|
+
const totalTimeSaved = reports.reduce((sum, r) => sum + r.time_saved, 0);
|
|
28
|
+
const avgTimeSaved = reports.length > 0 ? totalTimeSaved / reports.length : 0;
|
|
29
|
+
return {
|
|
30
|
+
reports: reports.map((r) => ({
|
|
31
|
+
create_time: r.create_time,
|
|
32
|
+
prompt: r.prompt,
|
|
33
|
+
session_link: r.session_link,
|
|
34
|
+
summary: r.summary,
|
|
35
|
+
time_saved_seconds: r.time_saved,
|
|
36
|
+
time_saved_minutes: Math.round(r.time_saved / 60),
|
|
37
|
+
})),
|
|
38
|
+
total_sessions: reports.length,
|
|
39
|
+
total_time_saved_seconds: totalTimeSaved,
|
|
40
|
+
total_time_saved_minutes: Math.round(totalTimeSaved / 60),
|
|
41
|
+
total_time_saved_hours: Math.round(totalTimeSaved / 3600 * 10) / 10,
|
|
42
|
+
avg_time_saved_seconds: Math.round(avgTimeSaved),
|
|
43
|
+
avg_time_saved_minutes: Math.round(avgTimeSaved / 60),
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=get-session-report.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-session-report.js","sourceRoot":"","sources":["../../src/tools/get-session-report.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACzC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;CACzB,CAAC,CAAC;AAIH;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,gB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AAG,EAAE,CAAC;QACzD,sBAAsB,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,GAAG,IAAI,GAAG,EAAE,CAAC,GAAG,EAAE;QACnE,sBAAsB,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC;QAChD,sBAAsB,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY,GAAG,EAAE,CAAC;KACtD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool: hawkeye_get_session_summary
|
|
3
|
+
* Gets detailed analysis and scoring for a session
|
|
4
|
+
*/
|
|
5
|
+
import { ToolServices } from './index.js';
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
/**
|
|
8
|
+
* Input validation schema
|
|
9
|
+
*/
|
|
10
|
+
declare const GetSessionSummaryInputSchema: z.ZodObject<{
|
|
11
|
+
session_uuid: z.ZodString;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
session_uuid: string;
|
|
14
|
+
}, {
|
|
15
|
+
session_uuid: string;
|
|
16
|
+
}>;
|
|
17
|
+
export type GetSessionSummaryInput = z.infer<typeof GetSessionSummaryInputSchema>;
|
|
18
|
+
/**
|
|
19
|
+
* Get session summary with quality scores
|
|
20
|
+
*/
|
|
21
|
+
export declare function getSessionSummary(services: ToolServices, args: unknown): Promise<any>;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool: hawkeye_get_session_summary
|
|
3
|
+
* Gets detailed analysis and scoring for a session
|
|
4
|
+
*/
|
|
5
|
+
import { logger } from '../utils/logger.js';
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
/**
|
|
8
|
+
* Input validation schema
|
|
9
|
+
*/
|
|
10
|
+
const GetSessionSummaryInputSchema = z.object({
|
|
11
|
+
session_uuid: z.string(),
|
|
12
|
+
});
|
|
13
|
+
/**
|
|
14
|
+
* Get session summary with quality scores
|
|
15
|
+
*/
|
|
16
|
+
export async function getSessionSummary(services, args) {
|
|
17
|
+
const input = GetSessionSummaryInputSchema.parse(args);
|
|
18
|
+
logger.info('Getting session summary', { sessionUuid: input.session_uuid });
|
|
19
|
+
// Get session summary
|
|
20
|
+
const summary = await services.sessionService.getSessionSummary(input.session_uuid);
|
|
21
|
+
logger.info('Session summary retrieved');
|
|
22
|
+
// Return the summary, handling cases where it might not be scored yet
|
|
23
|
+
if (!summary.analysis_score) {
|
|
24
|
+
return {
|
|
25
|
+
session_uuid: input.session_uuid,
|
|
26
|
+
message: 'This session has not been scored yet',
|
|
27
|
+
has_score: false,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
session_uuid: input.session_uuid,
|
|
32
|
+
has_score: true,
|
|
33
|
+
analysis_score: summary.analysis_score,
|
|
34
|
+
overall_accuracy_score: summary.analysis_score.accuracy.overall_score,
|
|
35
|
+
overall_completeness_score: summary.analysis_score.completeness.overall_score,
|
|
36
|
+
trust_without_review: summary.analysis_score.qualitative.trust_without_review,
|
|
37
|
+
scored_by: summary.analysis_score.scored_by,
|
|
38
|
+
improvement_suggestions: summary.analysis_score.qualitative.improvement_suggestions,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=get-session-summary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-session-summary.js","sourceRoot":"","sources":["../../src/tools/get-session-summary.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;CACzB,CAAC,CAAC;AAIH;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,QAAsB,EACtB,IAAa;IAEb,MAAM,KAAK,GAAG,4BAA4B,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAEvD,MAAM,CAAC,IAAI,CAAC,yBAAyB,EAAE,EAAE,WAAW,EAAE,KAAK,CAAC,YAAY,EAAE,CAAC,CAAC;IAE5E,sBAAsB;IACtB,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,cAAc,CAAC,iBAAiB,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IAEpF,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;IAEzC,sEAAsE;IACtE,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC;QAC5B,OAAO;YACL,YAAY,EAAE,KAAK,CAAC,YAAY;YAChC,OAAO,EAAE,sCAAsC;YAC/C,SAAS,EAAE,KAAK;SACjB,CAAC;IACJ,CAAC;IAED,OAAO;QACL,YAAY,EAAE,KAAK,CAAC,YAAY;QAChC,SAAS,EAAE,IAAI;QACf,cAAc,EAAE,OAAO,CAAC,cAAc;QACtC,sBAAsB,EAAE,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC,aAAa;QACrE,0BAA0B,EAAE,OAAO,CAAC,cAAc,CAAC,YAAY,CAAC,aAAa;QAC7E,oBAAoB,EAAE,OAAO,CAAC,cAAc,CAAC,WAAW,CAAC,oBAAoB;QAC7E,SAAS,EAAE,OAAO,CAAC,cAAc,CAAC,SAAS;QAC3C,uBAAuB,EAAE,OAAO,CAAC,cAAc,CAAC,WAAW,CAAC,uBAAuB;KACpF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool: hawkeye_get_investigation_status
|
|
3
|
+
* Gets the current status and results of an investigation
|
|
4
|
+
*/
|
|
5
|
+
import { ToolServices } from './index.js';
|
|
6
|
+
import { GetInvestigationStatusOutput } from '../types/mcp.js';
|
|
7
|
+
/**
|
|
8
|
+
* Get investigation status
|
|
9
|
+
*/
|
|
10
|
+
export declare function getInvestigationStatus(services: ToolServices, args: unknown): Promise<GetInvestigationStatusOutput>;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool: hawkeye_get_investigation_status
|
|
3
|
+
* Gets the current status and results of an investigation
|
|
4
|
+
*/
|
|
5
|
+
import { GetInvestigationStatusInputSchema } from '../utils/validation.js';
|
|
6
|
+
import { getConfig } from '../config/config.js';
|
|
7
|
+
import { logger } from '../utils/logger.js';
|
|
8
|
+
/**
|
|
9
|
+
* Get investigation status
|
|
10
|
+
*/
|
|
11
|
+
export async function getInvestigationStatus(services, args) {
|
|
12
|
+
const config = getConfig();
|
|
13
|
+
const input = GetInvestigationStatusInputSchema.parse(args);
|
|
14
|
+
logger.info('Getting investigation status', { sessionUuid: input.session_uuid });
|
|
15
|
+
// Get project UUID (use default if not provided)
|
|
16
|
+
const projectUuid = input.project_uuid || (await services.projectService.getDefaultProject()).uuid;
|
|
17
|
+
const organizationUuid = config.defaultOrganizationUuid;
|
|
18
|
+
// Inspect the session
|
|
19
|
+
const sessionDetails = await services.sessionService.inspectSession(input.session_uuid, projectUuid, organizationUuid);
|
|
20
|
+
// Determine status
|
|
21
|
+
const status = determineStatus(sessionDetails);
|
|
22
|
+
// Calculate progress if available
|
|
23
|
+
const progressPercentage = calculateProgress(sessionDetails);
|
|
24
|
+
// Get current step if investigation is in progress
|
|
25
|
+
const currentStep = getCurrentStep(sessionDetails);
|
|
26
|
+
// Format investigation results if complete
|
|
27
|
+
const investigationResults = status === 'completed' && input.include_full_details
|
|
28
|
+
? formatInvestigationResults(sessionDetails)
|
|
29
|
+
: undefined;
|
|
30
|
+
return {
|
|
31
|
+
session_uuid: input.session_uuid,
|
|
32
|
+
status,
|
|
33
|
+
progress_percentage: progressPercentage,
|
|
34
|
+
current_step: currentStep,
|
|
35
|
+
investigation_results: investigationResults,
|
|
36
|
+
created_at: sessionDetails.create_time || sessionDetails.created_at || '',
|
|
37
|
+
updated_at: sessionDetails.last_update || sessionDetails.updated_at || '',
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Determine investigation status from session details
|
|
42
|
+
*/
|
|
43
|
+
function determineStatus(session) {
|
|
44
|
+
// Check if final_answer is present
|
|
45
|
+
if (session.final_answer) {
|
|
46
|
+
return 'completed';
|
|
47
|
+
}
|
|
48
|
+
// Check state field if available
|
|
49
|
+
if (session.state) {
|
|
50
|
+
const state = session.state.toLowerCase();
|
|
51
|
+
if (state.includes('complete') || state.includes('done') || state.includes('finished')) {
|
|
52
|
+
return 'completed';
|
|
53
|
+
}
|
|
54
|
+
if (state.includes('fail') || state.includes('error')) {
|
|
55
|
+
return 'failed';
|
|
56
|
+
}
|
|
57
|
+
if (state.includes('progress') || state.includes('running') || state.includes('active')) {
|
|
58
|
+
return 'in_progress';
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
// If we have chain_of_thoughts but no final_answer, it's in progress
|
|
62
|
+
if (session.chain_of_thoughts && session.chain_of_thoughts.length > 0) {
|
|
63
|
+
return 'in_progress';
|
|
64
|
+
}
|
|
65
|
+
// Default to unknown
|
|
66
|
+
return 'unknown';
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Calculate progress percentage
|
|
70
|
+
*/
|
|
71
|
+
function calculateProgress(session) {
|
|
72
|
+
// If completed, return 100%
|
|
73
|
+
if (session.final_answer) {
|
|
74
|
+
return 100;
|
|
75
|
+
}
|
|
76
|
+
// If we have chain of thoughts, estimate based on typical investigation length
|
|
77
|
+
if (session.chain_of_thoughts && session.chain_of_thoughts.length > 0) {
|
|
78
|
+
// Typical investigation has 5-10 steps
|
|
79
|
+
const steps = session.chain_of_thoughts.length;
|
|
80
|
+
const estimatedTotal = 7; // Average expected steps
|
|
81
|
+
const progress = Math.min(Math.round((steps / estimatedTotal) * 100), 95);
|
|
82
|
+
return progress;
|
|
83
|
+
}
|
|
84
|
+
// No progress information available
|
|
85
|
+
return undefined;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Get current investigation step
|
|
89
|
+
*/
|
|
90
|
+
function getCurrentStep(session) {
|
|
91
|
+
if (session.final_answer) {
|
|
92
|
+
return 'Investigation complete';
|
|
93
|
+
}
|
|
94
|
+
if (session.chain_of_thoughts && session.chain_of_thoughts.length > 0) {
|
|
95
|
+
const latestThought = session.chain_of_thoughts[session.chain_of_thoughts.length - 1];
|
|
96
|
+
return latestThought.description || 'Analyzing data...';
|
|
97
|
+
}
|
|
98
|
+
return 'Starting investigation...';
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Format investigation results
|
|
102
|
+
*/
|
|
103
|
+
function formatInvestigationResults(session) {
|
|
104
|
+
return {
|
|
105
|
+
final_answer: session.final_answer,
|
|
106
|
+
chain_of_thoughts: session.chain_of_thoughts || [],
|
|
107
|
+
sources: session.sources || [],
|
|
108
|
+
follow_up_suggestions: generateFollowUpSuggestions(session),
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Generate follow-up suggestions
|
|
113
|
+
*/
|
|
114
|
+
function generateFollowUpSuggestions(session) {
|
|
115
|
+
const suggestions = [];
|
|
116
|
+
if (session.final_answer) {
|
|
117
|
+
suggestions.push('Can you provide more details about the root cause?');
|
|
118
|
+
suggestions.push('What are the exact steps to remediate this issue?');
|
|
119
|
+
suggestions.push('How can we prevent this from happening again?');
|
|
120
|
+
}
|
|
121
|
+
if (session.chain_of_thoughts && session.chain_of_thoughts.length > 0) {
|
|
122
|
+
suggestions.push('Can you explain the investigation process in more detail?');
|
|
123
|
+
}
|
|
124
|
+
if (session.sources && session.sources.length > 0) {
|
|
125
|
+
suggestions.push('Which logs or metrics were most relevant to this investigation?');
|
|
126
|
+
}
|
|
127
|
+
return suggestions;
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=get-status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-status.js","sourceRoot":"","sources":["../../src/tools/get-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QAC9B,qBAAqB,EAAE,2BAA2B,CAAC,OAAO,CAAC;KAC5D,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAS,2BAA2B,CAAC,OAA+B;IAClE,MAAM,WAAW,GAAa,EAAE,CAAC;IAEjC,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;QACzB,WAAW,CAAC,IAAI,CAAC,oDAAoD,CAAC,CAAC;QACvE,WAAW,CAAC,IAAI,CAAC,mDAAmD,CAAC,CAAC;QACtE,WAAW,CAAC,IAAI,CAAC,+CAA+C,CAAC,CAAC;IACpE,CAAC;IAED,IAAI,OAAO,CAAC,iBAAiB,IAAI,OAAO,CAAC,iBAAiB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtE,WAAW,CAAC,IAAI,CAAC,2DAA2D,CAAC,CAAC;IAChF,CAAC;IAED,IAAI,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAClD,WAAW,CAAC,IAAI,CAAC,iEAAiE,CAAC,CAAC;IACtF,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool registry for Hawkeye MCP Server
|
|
3
|
+
* Central place to register all MCP tools and their handlers
|
|
4
|
+
*/
|
|
5
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
6
|
+
import { ProjectService } from '../services/project.service.js';
|
|
7
|
+
import { SessionService } from '../services/session.service.js';
|
|
8
|
+
/**
|
|
9
|
+
* Services required by tool handlers
|
|
10
|
+
*/
|
|
11
|
+
export interface ToolServices {
|
|
12
|
+
projectService: ProjectService;
|
|
13
|
+
sessionService: SessionService;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Tool handler function signature
|
|
17
|
+
*/
|
|
18
|
+
export type ToolHandler = (services: ToolServices, args: unknown) => Promise<any>;
|
|
19
|
+
/**
|
|
20
|
+
* Tool definition with handler
|
|
21
|
+
*/
|
|
22
|
+
export interface ToolDefinition {
|
|
23
|
+
tool: Tool;
|
|
24
|
+
handler: ToolHandler;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Get all tool definitions
|
|
28
|
+
*/
|
|
29
|
+
export declare function getToolDefinitions(): ToolDefinition[];
|
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool registry for Hawkeye MCP Server
|
|
3
|
+
* Central place to register all MCP tools and their handlers
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Get all tool definitions
|
|
7
|
+
*/
|
|
8
|
+
export function getToolDefinitions() {
|
|
9
|
+
return [
|
|
10
|
+
// Phase 1 tools
|
|
11
|
+
getListProjectsTool(),
|
|
12
|
+
// Phase 2 tools
|
|
13
|
+
getInvestigateAlertTool(),
|
|
14
|
+
getInvestigationStatusTool(),
|
|
15
|
+
getContinueInvestigationTool(),
|
|
16
|
+
// Phase 3 tools - Session Management & Analytics
|
|
17
|
+
getListSessionsTool(),
|
|
18
|
+
getInspectSessionTool(),
|
|
19
|
+
getSessionReportTool(),
|
|
20
|
+
getSessionSummaryTool(),
|
|
21
|
+
getIncidentReportTool(),
|
|
22
|
+
];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Tool: hawkeye_list_projects
|
|
26
|
+
*/
|
|
27
|
+
function getListProjectsTool() {
|
|
28
|
+
return {
|
|
29
|
+
tool: {
|
|
30
|
+
name: 'hawkeye_list_projects',
|
|
31
|
+
description: 'Lists all available Hawkeye projects for the authenticated user',
|
|
32
|
+
inputSchema: {
|
|
33
|
+
type: 'object',
|
|
34
|
+
properties: {
|
|
35
|
+
include_inactive: {
|
|
36
|
+
type: 'boolean',
|
|
37
|
+
description: 'Include inactive projects in the list',
|
|
38
|
+
default: false,
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
handler: async (services, args) => {
|
|
44
|
+
const { ListProjectsInputSchema } = await import('../utils/validation.js');
|
|
45
|
+
const input = ListProjectsInputSchema.parse(args || {});
|
|
46
|
+
const projects = await services.projectService.listProjects(input.include_inactive);
|
|
47
|
+
const defaultProjectUuid = services.projectService.getDefaultProjectUuid();
|
|
48
|
+
return {
|
|
49
|
+
projects: projects.map((p) => ({
|
|
50
|
+
uuid: p.uuid,
|
|
51
|
+
name: p.name,
|
|
52
|
+
description: p.description,
|
|
53
|
+
state: p.state,
|
|
54
|
+
sync_state: p.sync_state,
|
|
55
|
+
training_state: p.training_state,
|
|
56
|
+
created_at: p.created_at,
|
|
57
|
+
updated_at: p.updated_at,
|
|
58
|
+
})),
|
|
59
|
+
default_project: defaultProjectUuid || undefined,
|
|
60
|
+
};
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Tool: hawkeye_investigate_alert
|
|
66
|
+
*/
|
|
67
|
+
function getInvestigateAlertTool() {
|
|
68
|
+
return {
|
|
69
|
+
tool: {
|
|
70
|
+
name: 'hawkeye_investigate_alert',
|
|
71
|
+
description: 'Finds an existing RCA or creates a new investigation for a specific alert/incident ID',
|
|
72
|
+
inputSchema: {
|
|
73
|
+
type: 'object',
|
|
74
|
+
properties: {
|
|
75
|
+
alert_id: {
|
|
76
|
+
type: 'string',
|
|
77
|
+
description: 'Full alert ID (e.g., /subscriptions/.../alerts/...)',
|
|
78
|
+
},
|
|
79
|
+
project_uuid: {
|
|
80
|
+
type: 'string',
|
|
81
|
+
description: 'Optional: project UUID. If not provided, will use default project',
|
|
82
|
+
},
|
|
83
|
+
wait_for_completion: {
|
|
84
|
+
type: 'boolean',
|
|
85
|
+
description: 'If true, polls until investigation completes',
|
|
86
|
+
default: false,
|
|
87
|
+
},
|
|
88
|
+
max_wait_seconds: {
|
|
89
|
+
type: 'number',
|
|
90
|
+
description: 'Maximum time to wait for completion (default: 300 seconds)',
|
|
91
|
+
default: 300,
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
required: ['alert_id'],
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
handler: async (services, args) => {
|
|
98
|
+
const { investigateAlert } = await import('./investigate-alert.js');
|
|
99
|
+
return investigateAlert(services, args);
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Tool: hawkeye_get_investigation_status
|
|
105
|
+
*/
|
|
106
|
+
function getInvestigationStatusTool() {
|
|
107
|
+
return {
|
|
108
|
+
tool: {
|
|
109
|
+
name: 'hawkeye_get_investigation_status',
|
|
110
|
+
description: 'Gets the current status and results of an ongoing or completed investigation',
|
|
111
|
+
inputSchema: {
|
|
112
|
+
type: 'object',
|
|
113
|
+
properties: {
|
|
114
|
+
session_uuid: {
|
|
115
|
+
type: 'string',
|
|
116
|
+
description: 'UUID of the investigation session',
|
|
117
|
+
},
|
|
118
|
+
project_uuid: {
|
|
119
|
+
type: 'string',
|
|
120
|
+
description: 'Optional: project UUID. If not provided, will use default project',
|
|
121
|
+
},
|
|
122
|
+
include_full_details: {
|
|
123
|
+
type: 'boolean',
|
|
124
|
+
description: 'Include full investigation results',
|
|
125
|
+
default: true,
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
required: ['session_uuid'],
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
handler: async (services, args) => {
|
|
132
|
+
const { getInvestigationStatus } = await import('./get-status.js');
|
|
133
|
+
return getInvestigationStatus(services, args);
|
|
134
|
+
},
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Tool: hawkeye_continue_investigation
|
|
139
|
+
*/
|
|
140
|
+
function getContinueInvestigationTool() {
|
|
141
|
+
return {
|
|
142
|
+
tool: {
|
|
143
|
+
name: 'hawkeye_continue_investigation',
|
|
144
|
+
description: 'Asks a follow-up question or provides additional context to an existing investigation',
|
|
145
|
+
inputSchema: {
|
|
146
|
+
type: 'object',
|
|
147
|
+
properties: {
|
|
148
|
+
session_uuid: {
|
|
149
|
+
type: 'string',
|
|
150
|
+
description: 'UUID of the investigation session',
|
|
151
|
+
},
|
|
152
|
+
follow_up_prompt: {
|
|
153
|
+
type: 'string',
|
|
154
|
+
description: 'The follow-up question or additional context',
|
|
155
|
+
},
|
|
156
|
+
project_uuid: {
|
|
157
|
+
type: 'string',
|
|
158
|
+
description: 'Optional: project UUID. If not provided, will use default project',
|
|
159
|
+
},
|
|
160
|
+
wait_for_completion: {
|
|
161
|
+
type: 'boolean',
|
|
162
|
+
description: 'If true, polls until investigation completes',
|
|
163
|
+
default: false,
|
|
164
|
+
},
|
|
165
|
+
max_wait_seconds: {
|
|
166
|
+
type: 'number',
|
|
167
|
+
description: 'Maximum time to wait for completion (default: 300 seconds)',
|
|
168
|
+
default: 300,
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
required: ['session_uuid', 'follow_up_prompt'],
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
handler: async (services, args) => {
|
|
175
|
+
const { continueInvestigation } = await import('./continue-investigation.js');
|
|
176
|
+
return continueInvestigation(services, args);
|
|
177
|
+
},
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Tool: hawkeye_list_sessions
|
|
182
|
+
*/
|
|
183
|
+
function getListSessionsTool() {
|
|
184
|
+
return {
|
|
185
|
+
tool: {
|
|
186
|
+
name: 'hawkeye_list_sessions',
|
|
187
|
+
description: 'Lists investigation sessions for a project with pagination and date filtering support',
|
|
188
|
+
inputSchema: {
|
|
189
|
+
type: 'object',
|
|
190
|
+
properties: {
|
|
191
|
+
project_uuid: {
|
|
192
|
+
type: 'string',
|
|
193
|
+
description: 'UUID of the project (optional, uses default if not provided)',
|
|
194
|
+
},
|
|
195
|
+
page: {
|
|
196
|
+
type: 'number',
|
|
197
|
+
description: 'Page number (1-indexed), default: 1',
|
|
198
|
+
},
|
|
199
|
+
limit: {
|
|
200
|
+
type: 'number',
|
|
201
|
+
description: 'Results per page (max 100), default: 50',
|
|
202
|
+
},
|
|
203
|
+
date_from: {
|
|
204
|
+
type: 'string',
|
|
205
|
+
description: 'ISO 8601 date or date string (e.g., "2024-01-01")',
|
|
206
|
+
},
|
|
207
|
+
date_to: {
|
|
208
|
+
type: 'string',
|
|
209
|
+
description: 'ISO 8601 date or date string',
|
|
210
|
+
},
|
|
211
|
+
organization_uuid: {
|
|
212
|
+
type: 'string',
|
|
213
|
+
description: 'Organization UUID (optional, defaults to ORGANIZATION_NAME_ROOT)',
|
|
214
|
+
},
|
|
215
|
+
only_uninvestigated: {
|
|
216
|
+
type: 'boolean',
|
|
217
|
+
description: 'Convenience parameter: when true, filters for incidents that have not been investigated yet (sets investigation_status to INVESTIGATION_STATUS_NOT_STARTED and session_type to SESSION_TYPE_INCIDENT)',
|
|
218
|
+
},
|
|
219
|
+
investigation_status: {
|
|
220
|
+
type: 'string',
|
|
221
|
+
description: 'Filter by investigation status (e.g., "INVESTIGATION_STATUS_NOT_STARTED", "INVESTIGATION_STATUS_IN_PROGRESS", "INVESTIGATION_STATUS_COMPLETED"). Use only_uninvestigated for convenience.',
|
|
222
|
+
},
|
|
223
|
+
session_type: {
|
|
224
|
+
type: 'string',
|
|
225
|
+
description: 'Filter by session type (e.g., "SESSION_TYPE_INCIDENT", "SESSION_TYPE_MANUAL")',
|
|
226
|
+
},
|
|
227
|
+
hide_grouped_incidents: {
|
|
228
|
+
type: 'boolean',
|
|
229
|
+
description: 'If true, hides incidents that have been grouped together. Default: false',
|
|
230
|
+
},
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
handler: async (services, args) => {
|
|
235
|
+
const { listSessions } = await import('./list-sessions.js');
|
|
236
|
+
return listSessions(services, args);
|
|
237
|
+
},
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Tool: hawkeye_inspect_session
|
|
242
|
+
*/
|
|
243
|
+
function getInspectSessionTool() {
|
|
244
|
+
return {
|
|
245
|
+
tool: {
|
|
246
|
+
name: 'hawkeye_inspect_session',
|
|
247
|
+
description: 'Gets detailed information about a session including all prompt cycles, chain of thoughts, sources, and follow-up suggestions',
|
|
248
|
+
inputSchema: {
|
|
249
|
+
type: 'object',
|
|
250
|
+
properties: {
|
|
251
|
+
session_uuid: {
|
|
252
|
+
type: 'string',
|
|
253
|
+
description: 'UUID of the session to inspect',
|
|
254
|
+
},
|
|
255
|
+
project_uuid: {
|
|
256
|
+
type: 'string',
|
|
257
|
+
description: 'Optional: project UUID. If not provided, will use default project',
|
|
258
|
+
},
|
|
259
|
+
organization_uuid: {
|
|
260
|
+
type: 'string',
|
|
261
|
+
description: 'Optional: organization UUID. Defaults to ORGANIZATION_NAME_ROOT',
|
|
262
|
+
},
|
|
263
|
+
},
|
|
264
|
+
required: ['session_uuid'],
|
|
265
|
+
},
|
|
266
|
+
},
|
|
267
|
+
handler: async (services, args) => {
|
|
268
|
+
const { inspectSession } = await import('./inspect-session.js');
|
|
269
|
+
return inspectSession(services, args);
|
|
270
|
+
},
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Tool: hawkeye_get_session_report
|
|
275
|
+
*/
|
|
276
|
+
function getSessionReportTool() {
|
|
277
|
+
return {
|
|
278
|
+
tool: {
|
|
279
|
+
name: 'hawkeye_get_session_report',
|
|
280
|
+
description: 'Gets summary reports for one or more sessions, including time-saved metrics',
|
|
281
|
+
inputSchema: {
|
|
282
|
+
type: 'object',
|
|
283
|
+
properties: {
|
|
284
|
+
session_uuids: {
|
|
285
|
+
type: 'array',
|
|
286
|
+
items: {
|
|
287
|
+
type: 'string',
|
|
288
|
+
},
|
|
289
|
+
description: 'Array of session UUIDs (can be single or multiple)',
|
|
290
|
+
},
|
|
291
|
+
project_uuid: {
|
|
292
|
+
type: 'string',
|
|
293
|
+
description: 'Project UUID (required)',
|
|
294
|
+
},
|
|
295
|
+
},
|
|
296
|
+
required: ['session_uuids', 'project_uuid'],
|
|
297
|
+
},
|
|
298
|
+
},
|
|
299
|
+
handler: async (services, args) => {
|
|
300
|
+
const { getSessionReport } = await import('./get-session-report.js');
|
|
301
|
+
return getSessionReport(services, args);
|
|
302
|
+
},
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Tool: hawkeye_get_session_summary
|
|
307
|
+
*/
|
|
308
|
+
function getSessionSummaryTool() {
|
|
309
|
+
return {
|
|
310
|
+
tool: {
|
|
311
|
+
name: 'hawkeye_get_session_summary',
|
|
312
|
+
description: 'Gets detailed analysis and scoring for a session, including accuracy and completeness metrics',
|
|
313
|
+
inputSchema: {
|
|
314
|
+
type: 'object',
|
|
315
|
+
properties: {
|
|
316
|
+
session_uuid: {
|
|
317
|
+
type: 'string',
|
|
318
|
+
description: 'UUID of the session',
|
|
319
|
+
},
|
|
320
|
+
},
|
|
321
|
+
required: ['session_uuid'],
|
|
322
|
+
},
|
|
323
|
+
},
|
|
324
|
+
handler: async (services, args) => {
|
|
325
|
+
const { getSessionSummary } = await import('./get-session-summary.js');
|
|
326
|
+
return getSessionSummary(services, args);
|
|
327
|
+
},
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Tool: hawkeye_get_incident_report
|
|
332
|
+
*/
|
|
333
|
+
function getIncidentReportTool() {
|
|
334
|
+
return {
|
|
335
|
+
tool: {
|
|
336
|
+
name: 'hawkeye_get_incident_report',
|
|
337
|
+
description: 'Gets comprehensive incident statistics and analytics across all investigations, including MTTR, time saved, and noise reduction metrics. No parameters required - returns organization-wide statistics.',
|
|
338
|
+
inputSchema: {
|
|
339
|
+
type: 'object',
|
|
340
|
+
properties: {},
|
|
341
|
+
},
|
|
342
|
+
},
|
|
343
|
+
handler: async (services, args) => {
|
|
344
|
+
const { getIncidentReport } = await import('./get-incident-report.js');
|
|
345
|
+
return getIncidentReport(services, args);
|
|
346
|
+
},
|
|
347
|
+
};
|
|
348
|
+
}
|
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