diff --git a/pkg/github/__toolsnaps__/create_pull_request.snap b/pkg/github/__toolsnaps__/create_pull_request.snap index a8a94ce69..ecf37b91c 100644 --- a/pkg/github/__toolsnaps__/create_pull_request.snap +++ b/pkg/github/__toolsnaps__/create_pull_request.snap @@ -9,6 +9,7 @@ } }, "annotations": { + "destructiveHint": true, "title": "Open new pull request" }, "description": "Create a new pull request in a GitHub repository.", diff --git a/pkg/github/pullrequests.go b/pkg/github/pullrequests.go index 0065b25a9..53ef3073a 100644 --- a/pkg/github/pullrequests.go +++ b/pkg/github/pullrequests.go @@ -545,8 +545,9 @@ func CreatePullRequest(t translations.TranslationHelperFunc) inventory.ServerToo Name: "create_pull_request", Description: t("TOOL_CREATE_PULL_REQUEST_DESCRIPTION", "Create a new pull request in a GitHub repository."), Annotations: &mcp.ToolAnnotations{ - Title: t("TOOL_CREATE_PULL_REQUEST_USER_TITLE", "Open new pull request"), - ReadOnlyHint: false, + Title: t("TOOL_CREATE_PULL_REQUEST_USER_TITLE", "Open new pull request"), + ReadOnlyHint: false, + DestructiveHint: jsonschema.Ptr(true), }, Meta: mcp.Meta{ "ui": map[string]any{ diff --git a/pkg/github/pullrequests_test.go b/pkg/github/pullrequests_test.go index 36a0207cc..055382454 100644 --- a/pkg/github/pullrequests_test.go +++ b/pkg/github/pullrequests_test.go @@ -1082,7 +1082,6 @@ func Test_SearchPullRequests(t *testing.T) { } }) } - } func Test_GetPullRequestFiles(t *testing.T) { @@ -2198,6 +2197,9 @@ func Test_CreatePullRequest(t *testing.T) { assert.Equal(t, "create_pull_request", tool.Name) assert.NotEmpty(t, tool.Description) + require.NotNil(t, tool.Annotations) + require.NotNil(t, tool.Annotations.DestructiveHint) + assert.True(t, *tool.Annotations.DestructiveHint) schema := tool.InputSchema.(*jsonschema.Schema) assert.Contains(t, schema.Properties, "owner") assert.Contains(t, schema.Properties, "repo")