Skip to content

Commit 9d798a0

Browse files
committed
Annotate create_issue and issue_write as destructive
Sets destructiveHint: true on the granular create_issue tool and the unified issue_write tool so the IFC client engine can apply egress policies before invocation, regardless of which surface the client uses. Refs github/copilot-mcp-core#1623.
1 parent 3a4bc26 commit 9d798a0

5 files changed

Lines changed: 8 additions & 4 deletions

File tree

pkg/github/__toolsnaps__/create_issue.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"annotations": {
3-
"destructiveHint": false,
3+
"destructiveHint": true,
44
"openWorldHint": true,
55
"title": "Create Issue"
66
},

pkg/github/__toolsnaps__/issue_write.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
}
1010
},
1111
"annotations": {
12+
"destructiveHint": true,
1213
"title": "Create or update issue."
1314
},
1415
"description": "Create a new or update an existing issue in a GitHub repository.",

pkg/github/issues.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,8 +1127,9 @@ func IssueWrite(t translations.TranslationHelperFunc) inventory.ServerTool {
11271127
Name: "issue_write",
11281128
Description: t("TOOL_ISSUE_WRITE_DESCRIPTION", "Create a new or update an existing issue in a GitHub repository."),
11291129
Annotations: &mcp.ToolAnnotations{
1130-
Title: t("TOOL_ISSUE_WRITE_USER_TITLE", "Create or update issue."),
1131-
ReadOnlyHint: false,
1130+
Title: t("TOOL_ISSUE_WRITE_USER_TITLE", "Create or update issue."),
1131+
ReadOnlyHint: false,
1132+
DestructiveHint: jsonschema.Ptr(true),
11321133
},
11331134
Meta: mcp.Meta{
11341135
"ui": map[string]any{

pkg/github/issues_granular.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ func GranularCreateIssue(t translations.TranslationHelperFunc) inventory.ServerT
117117
Annotations: &mcp.ToolAnnotations{
118118
Title: t("TOOL_CREATE_ISSUE_USER_TITLE", "Create Issue"),
119119
ReadOnlyHint: false,
120-
DestructiveHint: jsonschema.Ptr(false),
120+
DestructiveHint: jsonschema.Ptr(true),
121121
OpenWorldHint: jsonschema.Ptr(true),
122122
},
123123
InputSchema: &jsonschema.Schema{

pkg/github/issues_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,6 +1058,8 @@ func Test_CreateIssue(t *testing.T) {
10581058

10591059
assert.Equal(t, "issue_write", tool.Name)
10601060
assert.NotEmpty(t, tool.Description)
1061+
require.NotNil(t, tool.Annotations.DestructiveHint)
1062+
assert.True(t, *tool.Annotations.DestructiveHint)
10611063
assert.Contains(t, tool.InputSchema.(*jsonschema.Schema).Properties, "method")
10621064
assert.Contains(t, tool.InputSchema.(*jsonschema.Schema).Properties, "owner")
10631065
assert.Contains(t, tool.InputSchema.(*jsonschema.Schema).Properties, "repo")

0 commit comments

Comments
 (0)