Skip to content

fix: add DestructiveHint and OpenWorldHint to label_write annotations#2728

Draft
axelray-dev wants to merge 1 commit into
github:mainfrom
axelray-dev:fix/2723-add-destructive-hint-label-write
Draft

fix: add DestructiveHint and OpenWorldHint to label_write annotations#2728
axelray-dev wants to merge 1 commit into
github:mainfrom
axelray-dev:fix/2723-add-destructive-hint-label-write

Conversation

@axelray-dev

Copy link
Copy Markdown

Fixes #2723

Problem

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, its annotations only set ReadOnlyHint: false -- it does not set DestructiveHint: true or OpenWorldHint: true. MCP clients receive no destructive-operation signal for what is arguably the most destructive label operation available.

Fix

Add DestructiveHint: jsonschema.Ptr(true) and OpenWorldHint: jsonschema.Ptr(true) to the LabelWrite tool 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 definition
  • pkg/github/labels_test.go: Add DestructiveHint assertion in TestWriteLabel
  • pkg/github/__toolsnaps__/label_write.snap: Update snapshot to match

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
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

1 participant