diff --git a/pkg/github/__toolsnaps__/update_issue_assignees.snap b/pkg/github/__toolsnaps__/update_issue_assignees.snap index 088992dc3b..4e563189d8 100644 --- a/pkg/github/__toolsnaps__/update_issue_assignees.snap +++ b/pkg/github/__toolsnaps__/update_issue_assignees.snap @@ -1,6 +1,6 @@ { "annotations": { - "destructiveHint": false, + "destructiveHint": true, "idempotentHint": false, "openWorldHint": true, "readOnlyHint": false, diff --git a/pkg/github/__toolsnaps__/update_issue_labels.snap b/pkg/github/__toolsnaps__/update_issue_labels.snap index c0cfa73ad8..a780d3a172 100644 --- a/pkg/github/__toolsnaps__/update_issue_labels.snap +++ b/pkg/github/__toolsnaps__/update_issue_labels.snap @@ -1,6 +1,6 @@ { "annotations": { - "destructiveHint": false, + "destructiveHint": true, "idempotentHint": false, "openWorldHint": true, "readOnlyHint": false, diff --git a/pkg/github/granular_tools_test.go b/pkg/github/granular_tools_test.go index b63485fe9d..769b94a82a 100644 --- a/pkg/github/granular_tools_test.go +++ b/pkg/github/granular_tools_test.go @@ -2764,3 +2764,19 @@ func TestGranularRemovePullRequestReviewCommentReaction(t *testing.T) { }) } } + +func TestGranularUpdateIssueToolsAreDestructive(t *testing.T) { + t.Parallel() + + tools := map[string]inventory.ServerTool{ + "update_issue_assignees": GranularUpdateIssueAssignees(translations.NullTranslationHelper), + "update_issue_labels": GranularUpdateIssueLabels(translations.NullTranslationHelper), + } + for name, serverTool := range tools { + t.Run(name, func(t *testing.T) { + require.NotNil(t, serverTool.Tool.Annotations.DestructiveHint) + assert.True(t, *serverTool.Tool.Annotations.DestructiveHint, + "%s replaces the current values and removes any not in the list", name) + }) + } +} diff --git a/pkg/github/issues_granular.go b/pkg/github/issues_granular.go index eab4a204cd..3c4eede2ac 100644 --- a/pkg/github/issues_granular.go +++ b/pkg/github/issues_granular.go @@ -235,7 +235,7 @@ func GranularUpdateIssueAssignees(t translations.TranslationHelperFunc) inventor Annotations: &mcp.ToolAnnotations{ Title: t("TOOL_UPDATE_ISSUE_ASSIGNEES_USER_TITLE", "Update Issue Assignees"), ReadOnlyHint: false, - DestructiveHint: new(false), + DestructiveHint: new(true), OpenWorldHint: new(true), }, InputSchema: &jsonschema.Schema{ @@ -370,7 +370,7 @@ func GranularUpdateIssueLabels(t translations.TranslationHelperFunc) inventory.S Annotations: &mcp.ToolAnnotations{ Title: t("TOOL_UPDATE_ISSUE_LABELS_USER_TITLE", "Update Issue Labels"), ReadOnlyHint: false, - DestructiveHint: new(false), + DestructiveHint: new(true), OpenWorldHint: new(true), }, InputSchema: &jsonschema.Schema{