FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(labels): add DestructiveHint to label_write tool by syf2211 · Pull Request #2763 · github/github-mcp-server · GitHub

fix(labels): add DestructiveHint to label_write tool - #2763

Merged
SamMorrowDrums merged 2 commits into
github:mainfrom
syf2211:fix/label-write-destructive-hint
Jul 16, 2026
Merged

fix(labels): add DestructiveHint to label_write tool#2763
SamMorrowDrums merged 2 commits into
github:mainfrom
syf2211:fix/label-write-destructive-hint

Conversation

syf2211 commented Jun 24, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

Summary

Add DestructiveHint: true to the label_write tool annotations so MCP clients can surface appropriate warnings before repository-wide label deletions.

Motivation

The label_write tool supports create, update, and delete methods. The delete method permanently removes a label and all of its associations from every issue and PR in the repository. The tool currently only sets ReadOnlyHint: false, giving clients no destructive-operation signal.

Deleting a label removes it repository-wide from all issues and pull requests (GitHub API permanent delete).

Fixes #2723

Rationale

label_write is a multi-method tool (create / update / delete). MCP tool annotations are tool-scoped (no per-method hints), so we mark the entire tool destructiveHint: true when any method is destructive—matching projects_write and discussion_comment_write.

Changes

  • Set DestructiveHint: jsonschema.Ptr(true) on label_write in pkg/github/labels.go
  • Add DestructiveHint assertions in pkg/github/labels_test.go
  • Update label_write toolsnap

Tests

  • go test ./pkg/github -run 'TestWriteLabel' -count=1 -v — PASS

Impact

Hosts/clients may show destructive-operation warnings for all label_write calls, including create/update. This is intentional conservative labeling.

syf2211 requested a review from a team as a code owner June 24, 2026 11:13
The label_write delete method removes labels repository-wide but the tool
only advertised ReadOnlyHint:false. Set DestructiveHint:true so MCP clients
can warn before destructive label deletions, matching projects_write.

Fixes github#2723
syf2211 force-pushed the fix/label-write-destructive-hint branch from 78d4cfb to 3d8e86b Compare June 28, 2026 11:33
SamMorrowDrums previously approved these changes Jul 16, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: c999f008-c5da-4948-a6fd-e221ded750df
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

label_write delete is missing DestructiveHint: true annotation

2 participants


Back | FazBrowse Home | New Git URL