Skip to content

label_write delete is missing DestructiveHint: true annotation #2723

Description

@pritesh-lahoti

Describe the bug

The label_write tool (pkg/github/labels.go) supports a delete method that deletes a label at the repository level via the deleteLabel GraphQL mutation. This permanently removes the label and all of its associations from every issue and PR in the repository.

However, the tool's annotations only set ReadOnlyHint: false. It does not set DestructiveHint: true. As a result, MCP clients receive no destructive-operation signal for what is arguably the most destructive label operation available, and may not surface an appropriate confirmation prompt before executing it.

Expected behavior

label_write should be annotated with DestructiveHint: true (at minimum when method is delete), so MCP clients can warn the user before a repository-wide label deletion.

Precedent in the codebase

The annotation discipline already exists elsewhere in the same package:

  • remove_sub_issue correctly sets DestructiveHint: jsonschema.Ptr(true)
  • The non-destructive issue label update (update_issue_labels) sets DestructiveHint: jsonschema.Ptr(false)

label_write delete simply appears to have been missed.

Impact

An agent intending a minor change can trigger a repository-wide label deletion with no destructive-operation hint. Because deleting a label removes it from all issues/PRs, the associations cannot be automatically restored even if the label is recreated with the same name.

Version

Verified against the open-source github-mcp-server v1.4.0 (latest release) and the hosted GitHub Copilot MCP endpoint at api.githubcopilot.com/mcp/ (as of 2026-06-18). The missing annotation has been present since label_write was introduced (ref #312).

Activity

  1. github-actions commented on Jun 18, 2026

    @github-actions
    Contributor

    AI Assessment: Ready for Review

    This bug report provides a clear description of the problem, detailing how the label_write tool's delete method lacks the necessary DestructiveHint: true annotation. The expected behavior is also articulated well, indicating the need for appropriate warnings before executing the deletion.

    The report does not specify the affected version, which is a critical piece of information that should be included to facilitate further investigation. However, the rest of the information is solid and detailed, making it easy for maintainers to understand the issue at hand.

    Overall, the assessment is that the report is mostly complete but requires the affected version to be added to be fully ready for review. It would be helpful to include a recommendation for the reporter to specify the version.

  2. github-actions commented on Jun 18, 2026

    @github-actions
    Contributor

    AI Assessment: Ready for Review

    This bug report contains a clear and concise description of the problem, explaining how the label_write tool's delete method operates and the consequences of its current implementation.

    The affected version is not explicitly mentioned; however, the detailed description and analysis of the problem suggest that the issue is well understood. Moreover, the report provides expected behavior and relevant context about the codebase, including existing precedent, which indicates that the author conducted a thorough review.

    While the affected version could be explicitly stated for completeness, the other details are well-articulated and ready for a maintainer to review. It is not critical enough to be considered "Missing Details" since the essence of the problem and required changes are clearly presented.

  3. pritesh-lahoti commented on Jun 18, 2026

    @pritesh-lahoti
    Author

    Added the version section as requested. Verified against both github-mcp-server v1.4.0 (latest OSS release) and the hosted Copilot MCP endpoint. The missing annotation has been present since label_write was introduced in #312.

  4. added 2 commits that reference this issue on Jun 21, 2026
    6362492
    aede8e7
  5. added a commit that references this issue on Jun 28, 2026
    3d8e86b
  6. added a commit that references this issue on Jun 29, 2026
    20f9d88
  7. added a commit that references this issue on Jul 13, 2026
    478e81a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions