feat: add minimal output to pull request search#2675
Open
rodboev wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Completes the pull request search side of #1934 by adding a
minimal_outputoption tosearch_pull_requests, so review-queue searches can return compact PR metadata instead of the full GitHub search payload.Why
list_pull_requestsnow already maps results intoMinimalPullRequest, butsearch_pull_requestsstill calls the shared search helper and marshals the fullgithub.IssuesSearchResult. That leaves author-filtered and query-based PR workflows with the verbose user, URL, reaction, and metadata objects called out in the issue.Fixes #1934
What changed
pkg/github/pullrequests.go: add theminimal_outputparameter tosearch_pull_requests, default it to the compact path, and keep the raw response available when callers passminimal_output: false.pkg/github/minimal_types.go: map PR search items into a compact result containing total count, incomplete-results state, and essential PR fields from the existing search response.pkg/github/pullrequests_test.go: cover the default compact output and the raw-output escape hatch.pkg/github/__toolsnaps__/search_pull_requests.snapandREADME.md: regenerate schema and docs.MCP impact
search_pull_requestsgets a new optionalminimal_outputboolean; default behavior becomes compact, andminimal_output: falsepreserves the previous raw shape.Prompts tested (tool changes only)
Security / limits
Both the compact and raw paths use the existing
reposcope; this PR does not add any new OAuth scope or permission check.The compact path reduces returned metadata and does not add extra API calls or new scopes.
Tool renaming
deprecated_tool_aliases.goLint & tests
Linted locally with
./script/lint./script/lintwas not run locally. Direct lint command passed locally:golangci-lint runreported0 issues.Tested locally with
./script/test./script/testwas not run locally. The full race suite was not run locally. Focused package and generation checks passed locally:go test ./pkg/github -run "Test_SearchPullRequests|TestSearchPullRequests": passed. Covers the default compactsearch_pull_requestsresponse and theminimal_output: falseraw-compatibility path.UPDATE_TOOLSNAPS=true go test ./pkg/github: passed,ok github.com/github/github-mcp-server/pkg/github 5.017s. Regenerated and verifiedpkg/github/__toolsnaps__/search_pull_requests.snap.bash script/generate-docs: passed. Regenerated generated docs from the tool schema.Docs
Regenerated README/docs and updated
pkg/github/__toolsnaps__/search_pull_requests.snapfrom the tool schema.