diff --git a/pkg/github/__toolsnaps__/label_write.snap b/pkg/github/__toolsnaps__/label_write.snap index de4b98bef..ffd81a442 100644 --- a/pkg/github/__toolsnaps__/label_write.snap +++ b/pkg/github/__toolsnaps__/label_write.snap @@ -1,5 +1,7 @@ { "annotations": { + "destructiveHint": true, + "openWorldHint": true, "title": "Write operations on repository labels" }, "description": "Perform write operations on repository labels. To set labels on issues, use the 'update_issue' tool.", diff --git a/pkg/github/labels.go b/pkg/github/labels.go index 0e4996849..5c16e15fd 100644 --- a/pkg/github/labels.go +++ b/pkg/github/labels.go @@ -226,8 +226,10 @@ func LabelWrite(t translations.TranslationHelperFunc) inventory.ServerTool { Name: "label_write", Description: t("TOOL_LABEL_WRITE_DESCRIPTION", "Perform write operations on repository labels. To set labels on issues, use the 'update_issue' tool."), Annotations: &mcp.ToolAnnotations{ - Title: t("TOOL_LABEL_WRITE_TITLE", "Write operations on repository labels"), - ReadOnlyHint: false, + Title: t("TOOL_LABEL_WRITE_TITLE", "Write operations on repository labels"), + ReadOnlyHint: false, + DestructiveHint: jsonschema.Ptr(true), + OpenWorldHint: jsonschema.Ptr(true), }, InputSchema: &jsonschema.Schema{ Type: "object", diff --git a/pkg/github/labels_test.go b/pkg/github/labels_test.go index 88102ba3c..139a552c9 100644 --- a/pkg/github/labels_test.go +++ b/pkg/github/labels_test.go @@ -247,6 +247,8 @@ func TestWriteLabel(t *testing.T) { assert.Equal(t, "label_write", tool.Name) assert.NotEmpty(t, tool.Description) assert.False(t, tool.Annotations.ReadOnlyHint, "label_write tool should not be read-only") + require.NotNil(t, tool.Annotations.DestructiveHint, "label_write tool should have DestructiveHint set") + assert.True(t, *tool.Annotations.DestructiveHint, "label_write tool should be marked as destructive") tests := []struct { name string