Skip to content

Commit b57989c

Browse files
committed
chore(tools): remove interval deprecation warnings and dead requestHasArg helper
1 parent e87fc04 commit b57989c

4 files changed

Lines changed: 2 additions & 16 deletions

File tree

internal/infra/mcp/tools/README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,6 @@ Validation rules (helper: `utils.go`):
6767
Windowed queries carry a 60 s client-side PromQL `Timeout` to fail fast before the
6868
Sysdig edge proxy's own 80–90 s cut-off.
6969

70-
For `k8s_list_top_http_errors_in_pods` and `k8s_list_top_network_errors_in_pods`,
71-
`interval` (e.g. `"1h"`) is still supported as a relative-duration shorthand; `start`/`end`
72-
take precedence when both are provided.
73-
7470
# Adding a New Tool
7571

7672
1. **See other tools:** Check how other tools are implemented so you can have the context on how they should look like.

internal/infra/mcp/tools/tool_k8s_list_top_http_errors_in_pods.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func NewK8sListTopHttpErrorsInPods(sysdigClient sysdig.ExtendedClientWithRespons
2828

2929
func (t *K8sListTopHttpErrorsInPods) RegisterInServer(s *server.MCPServer) {
3030
tool := mcp.NewTool("k8s_list_top_http_errors_in_pods",
31-
mcp.WithDescription("Lists the pods with the highest rate of HTTP 4xx and 5xx errors over a time window, allowing filtering by cluster, namespace, workload type, and workload name. Pass start/end (RFC3339) for an explicit window, or interval for a relative duration."),
31+
mcp.WithDescription("Lists the pods with the highest rate of HTTP 4xx and 5xx errors over a time window, allowing filtering by cluster, namespace, workload type, and workload name. Pass start/end (RFC3339) to specify the window. The legacy 'interval' param is retained for backward compatibility; start/end take precedence when both are provided."),
3232
mcp.WithString("interval", mcp.Description("Time interval for the query (e.g. '1h', '30m'). Default is '1h'. Ignored when start/end are provided.")),
3333
mcp.WithString("cluster_name", mcp.Description("The name of the cluster to filter by.")),
3434
mcp.WithString("namespace_name", mcp.Description("The name of the namespace to filter by.")),

internal/infra/mcp/tools/tool_k8s_list_top_network_errors_in_pods.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func NewK8sListTopNetworkErrorsInPods(sysdigClient sysdig.ExtendedClientWithResp
2828

2929
func (t *K8sListTopNetworkErrorsInPods) RegisterInServer(s *server.MCPServer) {
3030
tool := mcp.NewTool("k8s_list_top_network_errors_in_pods",
31-
mcp.WithDescription("Shows the top network errors by pod over a time window, aggregated by cluster, namespace, workload type, and workload name. The result is an average rate of network errors per second. Pass start/end (RFC3339) for an explicit window, or interval for a relative duration."),
31+
mcp.WithDescription("Shows the top network errors by pod over a time window, aggregated by cluster, namespace, workload type, and workload name. The result is an average rate of network errors per second. Pass start/end (RFC3339) to specify the window. The legacy 'interval' param is retained for backward compatibility; start/end take precedence when both are provided."),
3232
mcp.WithString("interval", mcp.Description("Time interval for the query (e.g. '1h', '30m'). Default is '1h'. Ignored when start/end are provided.")),
3333
mcp.WithString("cluster_name", mcp.Description("The name of the cluster to filter by.")),
3434
mcp.WithString("namespace_name", mcp.Description("The name of the namespace to filter by.")),

internal/infra/mcp/tools/utils.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,3 @@ func ParseTimeWindow(request mcp.CallToolRequest, clk clock.Clock) (TimeWindow,
175175
return TimeWindow{Start: start, End: end}, nil
176176
}
177177

178-
// requestHasArg reports whether the caller explicitly supplied the named argument
179-
// (distinguishes "user passed empty string" from "user didn't pass the key at all").
180-
func requestHasArg(request mcp.CallToolRequest, name string) bool {
181-
args, ok := request.Params.Arguments.(map[string]any)
182-
if !ok {
183-
return false
184-
}
185-
_, present := args[name]
186-
return present
187-
}

0 commit comments

Comments
 (0)