Skip to content

feat: add minimal output to pull request search#2675

Open
rodboev wants to merge 1 commit into
github:mainfrom
rodboev:pr/search-pr-minimal-output
Open

feat: add minimal output to pull request search#2675
rodboev wants to merge 1 commit into
github:mainfrom
rodboev:pr/search-pr-minimal-output

Conversation

@rodboev

@rodboev rodboev commented Jun 11, 2026

Copy link
Copy Markdown

Summary

Completes the pull request search side of #1934 by adding a minimal_output option to search_pull_requests, so review-queue searches can return compact PR metadata instead of the full GitHub search payload.

Why

list_pull_requests now already maps results into MinimalPullRequest, but search_pull_requests still calls the shared search helper and marshals the full github.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 the minimal_output parameter to search_pull_requests, default it to the compact path, and keep the raw response available when callers pass minimal_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.snap and README.md: regenerate schema and docs.

MCP impact

  • No tool or API changes
  • Tool schema or behavior changed
    search_pull_requests gets a new optional minimal_output boolean; default behavior becomes compact, and minimal_output: false preserves the previous raw shape.
  • New tool added

Prompts tested (tool changes only)

  • "Search open pull requests in github/github-mcp-server that need review, return the essentials only."
  • "Search pull requests by author in github/github-mcp-server and return the full raw GitHub search payload."

Security / limits

  • No security or limits impact
  • Auth / permissions considered
    Both the compact and raw paths use the existing repo scope; this PR does not add any new OAuth scope or permission check.
  • Data exposure, filtering, or token/size limits considered
    The compact path reduces returned metadata and does not add extra API calls or new scopes.

Tool renaming

  • I am renaming tools as part of this PR (e.g. a part of a consolidation effort)
    • I have added the new tool aliases in deprecated_tool_aliases.go
  • I am not renaming tools as part of this PR

Lint & tests

  • Linted locally with ./script/lint
    ./script/lint was not run locally. Direct lint command passed locally: golangci-lint run reported 0 issues.

  • Tested locally with ./script/test
    ./script/test was 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 compact search_pull_requests response and the minimal_output: false raw-compatibility path.

  • UPDATE_TOOLSNAPS=true go test ./pkg/github: passed, ok github.com/github/github-mcp-server/pkg/github 5.017s. Regenerated and verified pkg/github/__toolsnaps__/search_pull_requests.snap.

  • bash script/generate-docs: passed. Regenerated generated docs from the tool schema.

Docs

  • Updated (README / docs / examples)
    Regenerated README/docs and updated pkg/github/__toolsnaps__/search_pull_requests.snap from the tool schema.
  • Not needed

@rodboev rodboev requested a review from a team as a code owner June 11, 2026 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add minimal_output parameter to list_pull_requests and search_pull_requests

1 participant