Skip to content

fix: add explicit destructiveHint false to non-destructive write tools - #3293

Open
larik15 wants to merge 1 commit into
github:mainfrom
larik15:fix/destructive-hint-non-destructive-tools
Open

larik15 wants to merge 1 commit into
github:mainfrom
larik15:fix/destructive-hint-non-destructive-tools

Conversation

@larik15

@larik15 larik15 commented Sep 16, 2026

Copy link
Copy Markdown

What

Several clearly additive write tools set ReadOnlyHint: false but omit
DestructiveHint, so the MCP ToolAnnotations contract defaults them to
destructiveHint: true. Conservative clients then require extra approval for
routine operations like creating a branch or opening a pull request.

This adds an explicit DestructiveHint: jsonschema.Ptr(false) to write tools
that only create or add, following the existing pattern in the granular
toolsets.

Tools annotated

  • create_gist
  • create_repository
  • fork_repository
  • create_branch
  • star_repository
  • create_pull_request
  • add_reply_to_pull_request_comment
  • add_comment_to_pending_review
  • add_issue_comment
  • request_copilot_review
  • create_repository_ruleset

Deliberately left conservative

Tools that can overwrite or remove existing state, or whose behaviour depends
on the requested method, keep the conservative default:

  • update_gist, update_issue_comment — overwrite existing content
  • create_or_update_file, push_files — can overwrite files
  • merge_pull_request — irreversible
  • update_pull_request_branch — can introduce conflicts
  • custom_properties_write — last-write-wins on concurrent updates
  • unstar_repository, dismiss_notification, mark_all_notifications_read — remove or reset state
  • issue_write, update_pull_request, issue_dependency_write, sub_issue_write, pull_request_review_write — method-dependent, including destructive methods

Testing

go test ./pkg/github/... passes. Tool snapshots updated for the annotated tools.

Fixes #3281

@larik15
larik15 requested a review from a team as a code owner September 16, 2026 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Non-destructive write tools omit destructiveHint: false, causing conservative approval prompts

1 participant