pull_request_read: support response field filtering
还没有人认领这个 Issue。
评估
调研方向
从 pull_request_read 入口开始,比较 list_pull_requests 和 search_pull_requests 中的字段过滤工作方式。跟踪列出的每个方法,尤其是 get_reviews 和 get_check_runs,以确定响应字段是如何表示和验证的。当调用方可以请求选定字段而不会收到不必要的 payload 数据,同时现有调用仍保持兼容时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
Describe the feature or problem you’d like to solve
list_pull_requests and search_pull_requests both support a fields parameter to trim response size to only what the caller needs. pull_request_read has no equivalent for any of its methods (get, get_diff, get_status, get_files, get_commits, get_review_comments, get_reviews, get_comments, get_check_runs) — every call always returns the full, maximally verbose payload.
This is a significant problem for get_reviews and get_check_runs specifically:
get_reviewsreturns the full reviewbodyfor every review, even when the caller only needsstateanduser.loginto compute a review decision. Bot-generated reviews (e.g. Copilot code review) can each be several KB of markdown.get_check_runsreturns a fully itemized list of every check run (name, URL, timestamps, etc.) even when the caller only needs an overall pass/fail signal —get_statusalready provides that more cheaply, but doesn't help when a specific failing check's name is needed.
In practice, this forces callers who just want a compact per-PR summary (review decision + CI status) into fetching and carrying far more data than necessary.
Proposed solution
Add a fields (or select) parameter to pull_request_read, consistent with the existing pattern on list_pull_requests/search_pull_requests:
- For
get_reviews: allow selecting a subset of{id, state, user, submitted_at, body}per review, defaulting to omitbody. - For
get_check_runs: allow afieldsfilter over per-check fields (name, conclusion, url, timestamps, etc.).
This lets callers request only the compact signals they need, keeping response size proportional to what's actually useful — the same benefit fields already provides on list_pull_requests and search_pull_requests.
Example prompts or workflows (for tools/toolsets only)
- "Summarize the review and CI status of every open PR across these 7 repositories" — an agent lists PRs per repo, then for each PR calls
pull_request_readwithmethod: get_reviews, fields: [state, user]andmethod: get_check_runs, fields: [name, conclusion]to build a compact status table, instead of ingesting full review bodies and full check-run details it never uses. - Any dashboard/digest/reporting tool that needs "is this PR approved and green?" for many PRs at once, without paying the cost of full review text and full check-run metadata per PR.
- Bulk PR triage workflows that classify PRs into buckets (needs review / blocked / ready to merge / stale) based only on review state and CI pass/fail, run across many repositories in a single pass.
Additional context
We hit this concretely in an automation agent that summarizes open PRs across several repositories into a digest: listing PRs, then calling get_reviews + get_check_runs per PR to classify each one, accumulated roughly 660KB of conversation context across ~110 tool calls (full unfiltered payloads for each call). The agent's next step then timed out entirely before producing any output. A single compact call per repository via GitHub CLI's gh pr list --json reviewDecision,statusCheckRollup,... returns equivalent information in a fraction of the size, precisely because it lets the caller select only the fields it needs — the same capability pull_request_read is missing.
- 主要语言
- Go
- 星标
- 33.1k
- 派生
- 5k
- 平均合并
- 2 天 15 小时
- 30 天内合并 PR
- 27
贡献指南
从这里开始
- 先读完整个 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
-
kind/bug needs-triage
难度 1/5 1 小时以内 新手友好度 72/100
matrixorigin/matrixone#29223 ·
-
needs-acceptance wg/data-plane-networking
难度 2/5 1-3 小时 新手友好度 78/100
vllm-project/semantic-router#4024 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
-
bug
难度 2/5 1-3 小时 新手友好度 86/100
alexgorbatchev/dotfiles#107 ·
-
难度 1/5 1 小时以内 新手友好度 84/100