Skip to content

fix(issues): annotate update_issue_labels and update_issue_assignees as destructive (#3760) - #3800

Open
yunusarda-sudo wants to merge 4 commits into
github:mainfrom
yunusarda-sudo:fix/annotate-destructive-issue-labels-assignees
Open

yunusarda-sudo wants to merge 4 commits into
github:mainfrom
yunusarda-sudo:fix/annotate-destructive-issue-labels-assignees

Conversation

@yunusarda-sudo

Copy link
Copy Markdown

Summary

Annotate granular tools update_issue_labels and update_issue_assignees with destructiveHint: 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 set DestructiveHint: new(false), incorrectly signaling to MCP clients and hosts that the operations are non-destructive and safe to execute without user confirmation.

What changed

  • Set DestructiveHint: new(true) in update_issue_assignees and update_issue_labels (pkg/github/issues_granular.go).
  • Added test assertions verifying DestructiveHint is true in TestGranularUpdateIssueAssignees and TestGranularUpdateIssueLabels (pkg/github/granular_tools_test.go).
  • Updated toolsnaps snapshots (update_issue_assignees.snap and update_issue_labels.snap).

MCP impact

  • Tool schema or behavior changed: destructiveHint changed from false to true in annotations for update_issue_labels and update_issue_assignees.

Prompts tested (tool changes only)

Security / limits

  • Auth / permissions considered: Hosts keying human approval on destructiveHint will now properly prompt before existing labels or assignees are removed by replacement.

Tool renaming

  • I am not renaming tools as part of this PR

Lint & tests

  • Linted locally with ./script/lint
  • Tested locally with ./script/test

Docs

  • Not needed

…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>
@yunusarda-sudo
yunusarda-sudo requested a review from a team as a code owner November 10, 2026 10:52
Copilot AI adaptive review requested due to automatic review settings November 10, 2026 10:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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_assignees and update_issue_labels as 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)

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.

update_issue_labels is annotated destructiveHint: false but replaces (removes) existing labels

2 participants