Skip to content
Closed
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
1 change: 1 addition & 0 deletions pkg/github/__toolsnaps__/create_pull_request.snap
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
}
},
"annotations": {
"destructiveHint": true,
"title": "Open new pull request"
},
"description": "Create a new pull request in a GitHub repository.",
Expand Down
5 changes: 3 additions & 2 deletions pkg/github/pullrequests.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
4 changes: 3 additions & 1 deletion pkg/github/pullrequests_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1082,7 +1082,6 @@ func Test_SearchPullRequests(t *testing.T) {
}
})
}

}

func Test_GetPullRequestFiles(t *testing.T) {
Expand Down Expand Up @@ -2198,6 +2197,9 @@ func Test_CreatePullRequest(t *testing.T) {

assert.Equal(t, "create_pull_request", tool.Name)
assert.NotEmpty(t, tool.Description)
Comment thread
gokhanarkan marked this conversation as resolved.
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")
Expand Down
Loading