fix: add DestructiveHint and OpenWorldHint to label_write annotations#2728
Draft
axelray-dev wants to merge 1 commit into
Draft
fix: add DestructiveHint and OpenWorldHint to label_write annotations#2728axelray-dev wants to merge 1 commit into
axelray-dev wants to merge 1 commit into
Conversation
The label_write tool supports a delete method that permanently removes a label and all its associations from every issue/PR in the repository. However, it only set ReadOnlyHint: false and did not signal the destructive nature of this operation to MCP clients. Add DestructiveHint: true and OpenWorldHint: true to match the pattern used by other destructive tools in the codebase (actions_run_trigger, projects_write, discussion_comment_write, remove_sub_issue). Fixes github#2723
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2723
Problem
The
label_writetool supports adeletemethod that permanently removes a label and all its associations from every issue/PR in the repository. However, its annotations only setReadOnlyHint: false-- it does not setDestructiveHint: trueorOpenWorldHint: true. MCP clients receive no destructive-operation signal for what is arguably the most destructive label operation available.Fix
Add
DestructiveHint: jsonschema.Ptr(true)andOpenWorldHint: jsonschema.Ptr(true)to theLabelWritetool annotations, matching the pattern used by other destructive tools in the codebase:actions_run_trigger(actions.go)projects_write(projects.go)discussion_comment_write(discussions.go)remove_sub_issue(issues_granular.go)Changes
pkg/github/labels.go: Add annotation fields to LabelWrite tool definitionpkg/github/labels_test.go: Add DestructiveHint assertion in TestWriteLabelpkg/github/__toolsnaps__/label_write.snap: Update snapshot to match