Add granular `add_label_to_issue` / `remove_label_from_issue` tools
還沒有人認領這個 Issue。
評估
研究方向
從 pkg/github/issues_granular.go 開始,將提議的工具與現有的 add_sub_issue 和 remove_sub_issue 模式進行比較。使用列出的 REST endpoint 新增和移除一個 label,然後驗證每個操作都保留 issue 的其他 label,並處理單一 issue 和 label。
由索引模型根據 Issue 內容生成。
描述
Describe the feature or problem you'd like to solve
There is currently no way to remove a single label from an issue without replacing the issue's entire label set. The only issue-label tool, update_issue_labels (pkg/github/issues_granular.go), states in its own description: "This replaces the current labels with the provided list."
To remove one label, a client must:
- Read all current labels on the issue
- Compute the full set minus the one to remove
- Send the complete remaining set back
If step 1 or 2 is incomplete or stale, labels are silently dropped. This read-modify-write pattern is error-prone for agents and adds round-trips.
Proposed solution
Add discrete, non-destructive tools backed by the existing REST endpoints:
add_label_to_issue→POST /repos/{owner}/{repo}/issues/{issue_number}/labelsremove_label_from_issue→DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}
These operate on a single label without touching the rest of the issue's labels.
Precedent in the codebase
Sub-issues already follow exactly this granular pattern with add_sub_issue and remove_sub_issue, rather than forcing a full-set replacement. Labels-on-issues would benefit from the same treatment.
Additional context
Related to #2412 (bulk/batch label operations). This proposal is the single-issue, single-label complement: #2412 covers operating across many issues at once, while this covers safely adding/removing one label on one issue without clobbering the others.
- 主要語言
- Go
- 星號
- 33.1k
- 分支
- 5k
- 平均合併
- 2 天 3 小時
- 30 天內合併 PR
- 18
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
github/github-mcp-server 的其他 Issue
-
bug
難度 2/5 1-3 小時 新手友好度 84/100
github/github-mcp-server#3235 ·
-
enhancement
難度 1/5 1 小時以內 新手友好度 88/100
github/github-mcp-server#3042 · 2 則留言 ·
-
bug
難度 2/5 1-3 小時 新手友好度 72/100
github/github-mcp-server#3032 · 1 個 reaction ·
-
難度 2/5 1-3 小時 新手友好度 74/100
github/github-mcp-server#2803 · 1 則留言 ·
-
難度 2/5 1-3 小時 新手友好度 76/100
github/github-mcp-server#2740 ·
查看 github/github-mcp-server 的全部 Issue
相似的 Issue
-
bug github_actions
難度 2/5 1-3 小時 新手友好度 75/100
registrystack/registry-stack#1393 ·
-
難度 2/5 1-3 小時 新手友好度 75/100
JakeChampion/lang#10213 ·
-
難度 2/5 1-3 小時 新手友好度 70/100
oasisprotocol/oasis-sdk#2523 ·
-
難度 2/5 1-3 小時 新手友好度 75/100
-
難度 2/5 1-3 小時 新手友好度 70/100