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 天 1 小时
- 30 天内合并 PR
- 25
贡献指南
从这里开始
- 先读完整个 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
-
textual definition
难度 1/5 1 小时以内 新手友好度 90/100
geneontology/go-ontology#32653 ·
-
难度 1/5 1 小时以内 新手友好度 75/100
-
needs design
难度 2/5 1-3 小时 新手友好度 75/100
-
Priority/High ready-for-agent Severity/Major Type/Bug
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 70/100