Skip to content

label_write delete is missing DestructiveHint: true annotation #2723

@pritesh-lahoti

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions