Skip to content
Draft
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: 2 additions & 0 deletions pkg/github/__toolsnaps__/label_write.snap
Original file line number Diff line number Diff line change
@@ -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.",
Expand Down
6 changes: 4 additions & 2 deletions pkg/github/labels.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions pkg/github/labels_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down