Skip to content
Open
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__/pull_request_review_write.snap
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"annotations": {
"destructiveHint": true,
"idempotentHint": false,
"readOnlyHint": false,
"title": "Write operations (create, submit, delete) on pull request reviews"
Expand Down
1 change: 1 addition & 0 deletions pkg/github/__toolsnaps__/sub_issue_write.snap
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"annotations": {
"destructiveHint": true,
"idempotentHint": false,
"readOnlyHint": false,
"title": "Change sub-issue"
Expand Down
5 changes: 3 additions & 2 deletions pkg/github/issues.go
Original file line number Diff line number Diff line change
Expand Up @@ -1384,8 +1384,9 @@ func SubIssueWrite(t translations.TranslationHelperFunc) inventory.ServerTool {
Name: "sub_issue_write",
Description: t("TOOL_SUB_ISSUE_WRITE_DESCRIPTION", "Add a sub-issue to a parent issue in a GitHub repository."),
Annotations: &mcp.ToolAnnotations{
Title: t("TOOL_SUB_ISSUE_WRITE_USER_TITLE", "Change sub-issue"),
ReadOnlyHint: false,
Title: t("TOOL_SUB_ISSUE_WRITE_USER_TITLE", "Change sub-issue"),
ReadOnlyHint: false,
DestructiveHint: jsonschema.Ptr(true),
},
InputSchema: &jsonschema.Schema{
Type: "object",
Expand Down
4 changes: 4 additions & 0 deletions pkg/github/issues_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3941,6 +3941,10 @@ func Test_AddSubIssue(t *testing.T) {

assert.Equal(t, "sub_issue_write", tool.Name)
assert.NotEmpty(t, tool.Description)
// remove deletes a sub-issue link, so clients must treat the tool as
// destructive and confirm before running it.
require.NotNil(t, tool.Annotations.DestructiveHint, "sub_issue_write should set DestructiveHint")
assert.True(t, *tool.Annotations.DestructiveHint, "sub_issue_write should be destructive")
assert.Contains(t, tool.InputSchema.(*jsonschema.Schema).Properties, "method")
assert.Contains(t, tool.InputSchema.(*jsonschema.Schema).Properties, "owner")
assert.Contains(t, tool.InputSchema.(*jsonschema.Schema).Properties, "repo")
Expand Down
5 changes: 3 additions & 2 deletions pkg/github/pullrequests.go
Original file line number Diff line number Diff line change
Expand Up @@ -1784,8 +1784,9 @@ Available methods:
- unresolve_thread: Unresolve a previously resolved review thread. Requires only "threadId" parameter. The owner, repo, and pullNumber parameters are not used for this method. Unresolving an already-unresolved thread is a no-op.
`),
Annotations: &mcp.ToolAnnotations{
Title: t("TOOL_PULL_REQUEST_REVIEW_WRITE_USER_TITLE", "Write operations (create, submit, delete) on pull request reviews"),
ReadOnlyHint: false,
Title: t("TOOL_PULL_REQUEST_REVIEW_WRITE_USER_TITLE", "Write operations (create, submit, delete) on pull request reviews"),
ReadOnlyHint: false,
DestructiveHint: jsonschema.Ptr(true),
},
InputSchema: schema,
},
Expand Down
4 changes: 4 additions & 0 deletions pkg/github/pullrequests_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2843,6 +2843,10 @@ func TestCreateAndSubmitPullRequestReview(t *testing.T) {

assert.Equal(t, "pull_request_review_write", tool.Name)
assert.NotEmpty(t, tool.Description)
// delete_pending discards a pending review's body, so clients must treat
// the tool as destructive and confirm before running it.
require.NotNil(t, tool.Annotations.DestructiveHint, "pull_request_review_write should set DestructiveHint")
assert.True(t, *tool.Annotations.DestructiveHint, "pull_request_review_write should be destructive")
schema := tool.InputSchema.(*jsonschema.Schema)
assert.Contains(t, schema.Properties, "method")
assert.Contains(t, schema.Properties, "owner")
Expand Down