Skip to content
Open
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
2 changes: 1 addition & 1 deletion pkg/github/__toolsnaps__/update_issue_assignees.snap
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"annotations": {
"destructiveHint": false,
"destructiveHint": true,
"idempotentHint": false,
"openWorldHint": true,
"readOnlyHint": false,
Expand Down
2 changes: 1 addition & 1 deletion pkg/github/__toolsnaps__/update_issue_labels.snap
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"annotations": {
"destructiveHint": false,
"destructiveHint": true,
"idempotentHint": false,
"openWorldHint": true,
"readOnlyHint": false,
Expand Down
16 changes: 16 additions & 0 deletions pkg/github/granular_tools_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Comment on lines +2778 to +2779
})
}
}
4 changes: 2 additions & 2 deletions pkg/github/issues_granular.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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{
Expand Down