Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,9 @@ public class AlertDefineToolsImpl implements AlertDefineTools {

@Override
@Tool(name = "create_alert_rule", description = """
HertzBeat: ALERT RULE means when to alert a user
THESE ARE ALERT RULES WITH THRESHOLD VALUES. USERS CAN SPECIFY THE THRESHOLD VALUES FOR EXAMPLE,
IF THE USER SAYS "ALERT ME WHEN MY COST EXCEEDS 700, THE EXPRESSION SHOULD BE 'cost > 700' NOT 'cost < 700'.
APPLY THE SAME LOGIC FOR LESS THAN OPERATOR.
HertzBeat: Create an alert rule that defines when HertzBeat should alert a user.
Preserve the user's threshold direction: "exceeds", "greater than", or "over" maps to `>`;
"less than", "below", or "under" maps to `<`.
Create a HertzBeat alert rule based on app hierarchy structure and user requirements.
It is important to first understand the hierarchy of apps, metrics, and field conditions
Each app has its own metrics and each metric has its own field conditions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public String getRealtimeMetrics(
try {
log.info("Getting real-time metrics for monitor {} and metrics {}", monitorId, metrics);
SubjectSum subjectSum = McpContextHolder.getSubject();
log.debug("Current subject in get_realtime_metrics tool: {}", subjectSum);
log.debug("Current subject in query_realtime_metrics tool: {}", subjectSum);

MetricsData metricsData = metricsDataService.getMetricsData(monitorId, metrics);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public String queryMonitors(

*********
VERY IMPORTANT:
ALWAYS use get_monitor_additional_params to check the additional required parameters for the chosen type before adding a monitor or even mentioning it.
ALWAYS use get_monitor_params to check the additional required parameters for the chosen type before adding a monitor or even mentioning it.
Use list_monitor_types tool to see available monitor type names to use here in the app parameter.
Use the information obtained from this to query user for parameters.
If the User has not given any parameters, ask them to provide the necessary parameters, until all the necessary parameters are provided.
Expand All @@ -227,7 +227,7 @@ public String queryMonitors(

PARAMETER MAPPING: Use the 'params' parameter to pass all monitor-specific configuration.
The params should be a JSON string containing key-value pairs for the monitor type.
Use get_monitor_additional_params tool to see what parameters are required for each monitor type.
Use get_monitor_params tool to see what parameters are required for each monitor type.

PARAMS EXAMPLES:
- Website: {"host":"example.com", "port":"443", "uri":"/api/health", "ssl":"true", "method":"GET"}
Expand All @@ -236,14 +236,14 @@ public String queryMonitors(
- Redis: {"host":"redis.server.com", "port":"6379", "password":"xxx"}
""")
public String addMonitor(
@ToolParam(description = "Monitor name (required)", required = true) String name,
@ToolParam(description = "Monitor type: website, mysql, postgresql, redis, linux, windows, etc.", required = true) String app,
@ToolParam(description = "Collection interval in seconds (default: 600)", required = false) Integer intervals,
@ToolParam(description = "Monitor-specific parameters as JSON string. "
+ "Use get_monitor_additional_params to see required fields. "
+ "Example: {\"host\":\"192.168.1.1\", \"port\":\"22\", \"username\":\"root\"}",
required = true) String params,
@ToolParam(description = "Monitor description (optional)", required = false) String description) {
@ToolParam(description = "Monitor name (required)", required = true) String name,
@ToolParam(description = "Monitor type: website, mysql, postgresql, redis, linux, windows, etc.", required = true) String app,
@ToolParam(description = "Collection interval in seconds (default: 600)", required = false) Integer intervals,
@ToolParam(description = "Monitor-specific parameters as JSON string. "
+ "Use get_monitor_params to see required fields. "
+ "Example: {\"host\":\"192.168.1.1\", \"port\":\"22\", \"username\":\"root\"}",
required = true) String params,
@ToolParam(description = "Monitor description (optional)", required = false) String description) {
return addMonitorProtected(null, name, app, intervals, params, description);
}

Expand All @@ -256,7 +256,7 @@ public String addMonitor(

*********
VERY IMPORTANT:
ALWAYS use get_monitor_additional_params to check the additional required parameters for the chosen type before adding a monitor or even mentioning it.
ALWAYS use get_monitor_params to check the additional required parameters for the chosen type before adding a monitor or even mentioning it.
Use list_monitor_types tool to see available monitor type names to use here in the app parameter.
Use the information obtained from this to query user for parameters.
If the User has not given any parameters, ask them to provide the necessary parameters, until all the necessary parameters are provided.
Expand All @@ -271,7 +271,7 @@ public String addMonitor(

PARAMETER MAPPING: Use the 'params' parameter to pass all monitor-specific configuration.
The params should be a JSON string containing key-value pairs for the monitor type.
Use get_monitor_additional_params tool to see what parameters are required for each monitor type.
Use get_monitor_params tool to see what parameters are required for each monitor type.

PARAMS EXAMPLES:
- Website: {"host":"example.com", "port":"443", "uri":"/api/health", "ssl":"true", "method":"GET"}
Expand All @@ -285,7 +285,7 @@ public String addMonitorProtected(
@ToolParam(description = "Monitor type: website, mysql, postgresql, redis, linux, windows, etc.", required = true) String app,
@ToolParam(description = "Collection interval in seconds (default: 600)", required = false) Integer intervals,
@ToolParam(description = "Monitor-specific parameters as JSON string. "
+ "Use get_monitor_additional_params to see required fields. "
+ "Use get_monitor_params to see required fields. "
+ "Example: {\"host\":\"192.168.1.1\", \"port\":\"22\", \"username\":\"root\"}",
required = true) String params,
@ToolParam(description = "Monitor description (optional)", required = false) String description) {
Expand All @@ -300,7 +300,7 @@ public String addMonitorProtected(
return "Error: Monitor type/application is required";
}
if (params == null || params.trim().isEmpty()) {
return "Error: Monitor params is required. Use get_monitor_additional_params to see required fields for this monitor type.";
return "Error: Monitor params is required. Use get_monitor_params to see required fields for this monitor type.";
}

// Set defaults
Expand Down Expand Up @@ -356,7 +356,7 @@ public String addMonitorProtected(
} catch (IllegalArgumentException argumentException) {
if (argumentException.getMessage().contains("required")) {
return String.format("Error: %s. "
+ "Or use get_monitor_additional_params tool to see all required parameters.",
+ "Or use get_monitor_params tool to see all required parameters.",
argumentException.getMessage());
} else {
return String.format("Error: %s. ", argumentException.getMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ public ScheduleToolsImpl(@Lazy SopScheduleService scheduleService,
}

@Override
@Tool(name = "createScheduleForConversation",
description = "Create a scheduled task to automatically execute a skill at specified times. "
+ "IMPORTANT: You must pass the conversationId from the system context (shown as 'Current Conversation ID' in the prompt). "
+ "The cron expression should be in 6-digit Spring format: 'seconds minutes hours dayOfMonth month dayOfWeek'. "
+ "Common examples: '0 0 9 * * ?' (daily at 9:00), '0 30 8 * * MON-FRI' (weekdays at 8:30).")
public String createSchedule(
@ToolParam(description = "Name of the skill to schedule (e.g., 'daily_inspection', 'mysql_slow_query_diagnosis')",
required = true) String skillName,
Expand Down Expand Up @@ -151,9 +146,6 @@ public String createScheduleWithConversation(
}

@Override
@Tool(name = "listSchedulesForConversation",
description = "List all scheduled tasks for a specific conversation. "
+ "Use the conversationId from the system context.")
public String listSchedules() {
// This method signature is kept for interface compatibility
return SopMessageUtil.getMessage("schedule.error.use.with.conversation");
Expand Down Expand Up @@ -212,7 +204,7 @@ public String listSchedulesWithConversation(

@Override
@Tool(name = "deleteSchedule",
description = "Delete a scheduled task by its ID. Use listSchedulesForConversation first to find the task ID.")
description = "Delete a scheduled task by its ID. Use listSchedulesWithConversation first to find the task ID.")
public String deleteSchedule(
@ToolParam(description = "ID of the schedule to delete", required = true) Long scheduleId) {

Expand All @@ -237,7 +229,7 @@ public String deleteSchedule(

@Override
@Tool(name = "toggleSchedule",
description = "Enable or disable a scheduled task. Use listSchedulesForConversation first to find the task ID.")
description = "Enable or disable a scheduled task. Use listSchedulesWithConversation first to find the task ID.")
public String toggleSchedule(
@ToolParam(description = "ID of the schedule to toggle", required = true) Long scheduleId,
@ToolParam(description = "true to enable, false to disable", required = true) boolean enabled) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public String listSkills() {

@Override
@Tool(name = "executeSkill",
description = "Execute a diagnostic skill. For skills requiring monitorId, first use queryMonitors "
description = "Execute a diagnostic skill. For skills requiring monitorId, first use query_monitors "
+ "to find the target monitor's ID. Report-type skills will return results directly to the user "
+ "without further AI processing. Use listSkills to see available skills.")
public String executeSkill(
Expand Down
Loading
Loading