Skip to content

Commit 4c1ee42

Browse files
committed
Tweak tool name and description
1 parent 53e4b0b commit 4c1ee42

File tree

5 files changed

+25
-14
lines changed

5 files changed

+25
-14
lines changed

internal/toolsets/vulnerability/clusters.go

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ type getClustersForCVETool struct {
4747
client *client.Client
4848
}
4949

50-
// NewGetClustersForCVETool creates a new get_clusters_for_cve tool.
50+
// NewGetClustersForCVETool creates a new get_clusters_with_orchestrator_cve tool.
5151
func NewGetClustersForCVETool(c *client.Client) toolsets.Tool {
5252
return &getClustersForCVETool{
53-
name: "get_clusters_for_cve",
53+
name: "get_clusters_with_orchestrator_cve",
5454
client: c,
5555
}
5656
}
@@ -68,8 +68,12 @@ func (t *getClustersForCVETool) GetName() string {
6868
// GetTool returns the MCP Tool definition.
6969
func (t *getClustersForCVETool) GetTool() *mcp.Tool {
7070
return &mcp.Tool{
71-
Name: t.name,
72-
Description: "Get list of clusters affected by a specific CVE",
71+
Name: t.name,
72+
Description: "Get list of clusters where a specified CVE is detected in Kubernetes orchestrator components" +
73+
" (kube-apiserver, kubelet, etcd, etc.)." +
74+
" Returns clusters where the Kubernetes infrastructure itself has the vulnerability." +
75+
" For comprehensive CVE analysis, also check get_deployments_for_cve (application workloads)" +
76+
" and get_nodes_for_cve (node OS packages).",
7377
InputSchema: getClustersForCVEInputSchema(),
7478
}
7579
}
@@ -87,7 +91,8 @@ func getClustersForCVEInputSchema() *jsonschema.Schema {
8791
schema.Required = []string{"cveName"}
8892

8993
schema.Properties["cveName"].Description = "CVE name to filter clusters (e.g., CVE-2021-44228)"
90-
schema.Properties["filterClusterId"].Description = "Optional cluster ID to verify if a specific cluster is affected"
94+
schema.Properties["filterClusterId"].Description = "Optional cluster ID to verify if a specified CVE" +
95+
" is detected on that cluster"
9196

9297
return schema
9398
}

internal/toolsets/vulnerability/clusters_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ import (
1717
func TestNewGetClustersForCVETool(t *testing.T) {
1818
tool := NewGetClustersForCVETool(&client.Client{})
1919
require.NotNil(t, tool)
20-
assert.Equal(t, "get_clusters_for_cve", tool.GetName())
20+
assert.Equal(t, "get_clusters_with_orchestrator_cve", tool.GetName())
2121
}
2222

2323
func TestGetClustersForCVETool_IsReadOnly(t *testing.T) {
2424
c := &client.Client{}
2525
tool := NewGetClustersForCVETool(c)
2626

27-
assert.True(t, tool.IsReadOnly(), "get_clusters_for_cve should be read-only")
27+
assert.True(t, tool.IsReadOnly(), "get_clusters_with_orchestrator_cve should be read-only")
2828
}
2929

3030
func TestGetClustersForCVETool_GetTool(t *testing.T) {
@@ -34,8 +34,8 @@ func TestGetClustersForCVETool_GetTool(t *testing.T) {
3434
mcpTool := tool.GetTool()
3535

3636
require.NotNil(t, mcpTool)
37-
assert.Equal(t, "get_clusters_for_cve", mcpTool.Name)
38-
assert.Contains(t, mcpTool.Description, "clusters affected")
37+
assert.Equal(t, "get_clusters_with_orchestrator_cve", mcpTool.Name)
38+
assert.Contains(t, mcpTool.Description, "clusters where a specified CVE is detected")
3939
assert.NotNil(t, mcpTool.InputSchema)
4040
}
4141

internal/toolsets/vulnerability/deployments.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,11 @@ func (t *getDeploymentsForCVETool) GetName() string {
9292
// GetTool returns the MCP Tool definition.
9393
func (t *getDeploymentsForCVETool) GetTool() *mcp.Tool {
9494
return &mcp.Tool{
95-
Name: t.name,
96-
Description: "Get list of deployments affected by a specific CVE",
95+
Name: t.name,
96+
Description: "Get list of deployments where a specified CVE is detected in application" +
97+
" or platform container images. Checks user workloads for vulnerabilities." +
98+
" For complete CVE analysis, also check get_clusters_with_orchestrator_cve (Kubernetes components)" +
99+
" and get_nodes_for_cve (node OS).",
97100
InputSchema: getDeploymentsForCVEInputSchema(),
98101
}
99102
}

internal/toolsets/vulnerability/nodes.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,11 @@ func (t *getNodesForCVETool) GetName() string {
7272
// GetTool returns the MCP Tool definition.
7373
func (t *getNodesForCVETool) GetTool() *mcp.Tool {
7474
return &mcp.Tool{
75-
Name: t.name,
76-
Description: "Get aggregated node groups affected by a specific CVE, grouped by cluster and operating system image",
75+
Name: t.name,
76+
Description: "Get aggregated node groups where a specified CVE is detected in node operating system packages" +
77+
", grouped by cluster and OS image. Checks OS-level vulnerabilities on cluster nodes." +
78+
" For comprehensive CVE coverage, also use get_clusters_with_orchestrator_cve (K8s components)" +
79+
" and get_deployments_for_cve (workloads).",
7780
InputSchema: getNodesForCVEInputSchema(),
7881
}
7982
}

internal/toolsets/vulnerability/toolset_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func TestToolset_IsEnabled_True(t *testing.T) {
4141
require.Len(t, tools, 3, "Should have all vulnerability tools")
4242
assert.Equal(t, "get_deployments_for_cve", tools[0].GetName())
4343
assert.Equal(t, "get_nodes_for_cve", tools[1].GetName())
44-
assert.Equal(t, "get_clusters_for_cve", tools[2].GetName())
44+
assert.Equal(t, "get_clusters_with_orchestrator_cve", tools[2].GetName())
4545
}
4646

4747
func TestToolset_IsEnabled_False(t *testing.T) {

0 commit comments

Comments
 (0)