Skip to content

Commit 53ad225

Browse files
committed
feat: add destructive hint annotations to all MCP tools
1 parent 4735fd2 commit 53ad225

21 files changed

+21
-0
lines changed

internal/infra/mcp/tools/tool_generate_sysql.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ func (h *ToolGenerateSysql) RegisterInServer(s *server.MCPServer) {
5454
),
5555
mcp.WithOutputSchema[map[string]any](),
5656
mcp.WithReadOnlyHintAnnotation(true),
57+
mcp.WithDestructiveHintAnnotation(false),
5758
WithRequiredPermissions("sage.exec"),
5859
)
5960
s.AddTool(tool, h.handle)

internal/infra/mcp/tools/tool_get_event_info.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ func (h *ToolGetEventInfo) RegisterInServer(s *server.MCPServer) {
4444
),
4545
mcp.WithOutputSchema[map[string]any](),
4646
mcp.WithReadOnlyHintAnnotation(true),
47+
mcp.WithDestructiveHintAnnotation(false),
4748
WithRequiredPermissions("policy-events.read"),
4849
)
4950

internal/infra/mcp/tools/tool_get_event_process_tree.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ func (h *ToolGetEventProcessTree) RegisterInServer(s *server.MCPServer) {
6262
),
6363
mcp.WithOutputSchema[map[string]any](),
6464
mcp.WithReadOnlyHintAnnotation(true),
65+
mcp.WithDestructiveHintAnnotation(false),
6566
WithRequiredPermissions("policy-events.read"),
6667
)
6768

internal/infra/mcp/tools/tool_kubernetes_list_clusters.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ func (t *KubernetesListClusters) RegisterInServer(s *server.MCPServer) {
3131
),
3232
mcp.WithOutputSchema[map[string]any](),
3333
mcp.WithReadOnlyHintAnnotation(true),
34+
mcp.WithDestructiveHintAnnotation(false),
3435
WithRequiredPermissions(), // FIXME(fede): Add the required permissions. It should be `promql.exec` but somehow the token does not have that permission even if you are able to execute queries.
3536
)
3637
s.AddTool(tool, t.handle)

internal/infra/mcp/tools/tool_kubernetes_list_cronjobs.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ func (t *KubernetesListCronjobs) RegisterInServer(s *server.MCPServer) {
3434
),
3535
mcp.WithOutputSchema[map[string]any](),
3636
mcp.WithReadOnlyHintAnnotation(true),
37+
mcp.WithDestructiveHintAnnotation(false),
3738
WithRequiredPermissions(), // FIXME(fede): Add the required permissions. It should be `promql.exec` but somehow the token does not have that permission even if you are able to execute queries.
3839
)
3940
s.AddTool(tool, t.handle)

internal/infra/mcp/tools/tool_kubernetes_list_nodes.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ func (t *KubernetesListNodes) RegisterInServer(s *server.MCPServer) {
3333
),
3434
mcp.WithOutputSchema[map[string]any](),
3535
mcp.WithReadOnlyHintAnnotation(true),
36+
mcp.WithDestructiveHintAnnotation(false),
3637
WithRequiredPermissions(), // FIXME(fede): Add the required permissions. It should be `promql.exec` but somehow the token does not have that permission even if you are able to execute queries.
3738
)
3839
s.AddTool(tool, t.handle)

internal/infra/mcp/tools/tool_kubernetes_list_pod_containers.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ func (t *KubernetesListPodContainers) RegisterInServer(s *server.MCPServer) {
3939
),
4040
mcp.WithOutputSchema[map[string]any](),
4141
mcp.WithReadOnlyHintAnnotation(true),
42+
mcp.WithDestructiveHintAnnotation(false),
4243
WithRequiredPermissions(), // FIXME(fede): Add the required permissions. It should be `promql.exec` but somehow the token does not have that permission even if you are able to execute queries.
4344
)
4445
s.AddTool(tool, t.handle)

internal/infra/mcp/tools/tool_kubernetes_list_workloads.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ func (t *KubernetesListWorkloads) RegisterInServer(s *server.MCPServer) {
4343
),
4444
mcp.WithOutputSchema[map[string]any](),
4545
mcp.WithReadOnlyHintAnnotation(true),
46+
mcp.WithDestructiveHintAnnotation(false),
4647
WithRequiredPermissions(), // FIXME(fede): Add the required permissions. It should be `promql.exec` but somehow the token does not have that permission even if you are able to execute queries.
4748
)
4849
s.AddTool(tool, t.handle)

internal/infra/mcp/tools/tool_list_runtime_events.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ You can specify the severity of the events based on the following cases:
100100
),
101101
mcp.WithOutputSchema[map[string]any](),
102102
mcp.WithReadOnlyHintAnnotation(true),
103+
mcp.WithDestructiveHintAnnotation(false),
103104
WithRequiredPermissions("policy-events.read"),
104105
)
105106

internal/infra/mcp/tools/tool_run_sysql.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ func (h *ToolRunSysql) RegisterInServer(s *server.MCPServer) {
6161
),
6262
mcp.WithOutputSchema[map[string]any](),
6363
mcp.WithReadOnlyHintAnnotation(true),
64+
mcp.WithDestructiveHintAnnotation(false),
6465
WithRequiredPermissions("sage.exec", "risks.read"),
6566
)
6667
s.AddTool(tool, h.handle)

0 commit comments

Comments
 (0)