Skip to content

Commit 714aa46

Browse files
committed
Annotate create_pull_request as destructive
Sets destructiveHint: true on create_pull_request so the IFC client engine can apply egress policies before invocation. Refs github/copilot-mcp-core#1623.
1 parent 3a4bc26 commit 714aa46

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

pkg/github/__toolsnaps__/create_pull_request.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": "Open new pull request"
1314
},
1415
"description": "Create a new pull request in a GitHub repository.",

pkg/github/pullrequests.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -545,8 +545,9 @@ func CreatePullRequest(t translations.TranslationHelperFunc) inventory.ServerToo
545545
Name: "create_pull_request",
546546
Description: t("TOOL_CREATE_PULL_REQUEST_DESCRIPTION", "Create a new pull request in a GitHub repository."),
547547
Annotations: &mcp.ToolAnnotations{
548-
Title: t("TOOL_CREATE_PULL_REQUEST_USER_TITLE", "Open new pull request"),
549-
ReadOnlyHint: false,
548+
Title: t("TOOL_CREATE_PULL_REQUEST_USER_TITLE", "Open new pull request"),
549+
ReadOnlyHint: false,
550+
DestructiveHint: jsonschema.Ptr(true),
550551
},
551552
Meta: mcp.Meta{
552553
"ui": map[string]any{

pkg/github/pullrequests_test.go

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

21992199
assert.Equal(t, "create_pull_request", tool.Name)
22002200
assert.NotEmpty(t, tool.Description)
2201+
require.NotNil(t, tool.Annotations.DestructiveHint)
2202+
assert.True(t, *tool.Annotations.DestructiveHint)
22012203
schema := tool.InputSchema.(*jsonschema.Schema)
22022204
assert.Contains(t, schema.Properties, "owner")
22032205
assert.Contains(t, schema.Properties, "repo")

0 commit comments

Comments
 (0)