Repository navigation
fix(issues): annotate update_issue_labels and update_issue_assignees as destructive (#3760) - #3800
Open
yunusarda-sudo wants to merge 4 commits into
Conversation
…as destructive (github#3760) The granular tools update_issue_labels and update_issue_assignees replace the current labels and assignees of an existing issue with the provided list. Any labels or assignees not included in the payload are removed via PATCH /repos/{owner}/{repo}/issues/{issue_number}. Previously, both tools set DestructiveHint: new(false) in their annotations, signaling to MCP clients that the operations are safe/non-destructive. A client or host keying user confirmation on destructiveHint would execute these without prompting, removing existing labels or assignees silently. Set DestructiveHint: new(true) for both tools, update toolsnaps, and add test assertions. Fixes github#3760 Co-authored-by: Rafe Walker <rafe-walker@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active issues are identified, and the metadata changes are accompanied by matching assertions and updated schema snapshots.
No open issues 🎉
What changed in this PR
Corrects MCP metadata for granular issue label and assignee replacement tools so clients recognize that omitted existing values may be removed.
Changes:
- Marks
update_issue_assigneesandupdate_issue_labelsas destructive. - Adds assertions verifying the destructive annotations.
- Updates the corresponding tool schema snapshots.
| File | Description |
|---|---|
| pkg/github/issues_granular.go | Marks the issue label and assignee replacement tools as destructive. |
| pkg/github/granular_tools_test.go | Adds assertions verifying both tools expose a true destructive hint. |
| pkg/github/__toolsnaps__/update_issue_labels.snap | Updates the label tool schema snapshot to reflect its destructive annotation. |
| pkg/github/__toolsnaps__/update_issue_assignees.snap | Updates the assignee tool schema snapshot to reflect its destructive annotation. |
Review effort: Lite (auto)
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.
Summary
Annotate granular tools
update_issue_labelsandupdate_issue_assigneeswithdestructiveHint: true.Why
Fixes #3760
Both tools replace the current list of labels/assignees with the provided list (using
PATCH /repos/{owner}/{repo}/issues/{issue_number}). Any existing labels or assignees omitted from the input are removed. Previously, both tools setDestructiveHint: new(false), incorrectly signaling to MCP clients and hosts that the operations are non-destructive and safe to execute without user confirmation.What changed
DestructiveHint: new(true)inupdate_issue_assigneesandupdate_issue_labels(pkg/github/issues_granular.go).DestructiveHintistrueinTestGranularUpdateIssueAssigneesandTestGranularUpdateIssueLabels(pkg/github/granular_tools_test.go).update_issue_assignees.snapandupdate_issue_labels.snap).MCP impact
destructiveHintchanged fromfalsetotruein annotations forupdate_issue_labelsandupdate_issue_assignees.Prompts tested (tool changes only)
update_issue_labels)update_issue_assignees)Security / limits
destructiveHintwill now properly prompt before existing labels or assignees are removed by replacement.Tool renaming
Lint & tests
./script/lint./script/testDocs