Skip to content

Allow selecting fields in pull request file responses - #3242

Open
adbcodes wants to merge 2 commits into
github:mainfrom
adbcodes:fix/3236-pr-file-fields
Open

Allow selecting fields in pull request file responses#3242
adbcodes wants to merge 2 commits into
github:mainfrom
adbcodes:fix/3236-pr-file-fields

Conversation

@adbcodes

@adbcodes adbcodes commented Sep 7, 2026

Copy link
Copy Markdown

Summary

Adds optional fields selection to pull_request_read with method: "get_files", allowing callers to request filenames or metadata without patches. Omitting fields or passing an empty array preserves the existing response.

Why

Callers needing only changed filenames currently receive potentially large patches, consuming unnecessary model context.
Fixes #3236

What changed

  • Added optional fields to the tool schema using existing field-selection helpers.
  • Added regression tests and updated the tool schema snapshot and README.

MCP impact

  • No tool or API changes
  • Tool schema or behavior changed
  • New tool added

Added optional fields for get_files. Existing calls continue returning the full response.

Prompts tested (tool changes only)

Tested through Codex CLI connected to the fixed local MCP server, using github/github-mcp-server PR #2666:

  • “List only the filenames changed.”
    Selected filename only; response contained no patches.
  • “Show the changed filenames and their statuses. Omit patches.”
    Selected filename and status only.
  • “Show the filenames and patches.”
    Selected filename and patch; patches were returned.

Verified the generated tool arguments and raw MCP responses.

Security / limits

  • No security or limits impact
  • Auth / permissions considered
  • Data exposure, filtering, or token/size limits considered

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

Note: if you're renaming tools, you must add the tool aliases. For more information on how to do so, please refer to the official docs.

Lint & tests

  • Linted locally with ./script/lint
  • Tested locally with ./script/test

Docs

  • Not needed
  • Updated (README / docs / examples)

@adbcodes
adbcodes marked this pull request as ready for review September 7, 2026 23:44
@adbcodes
adbcodes requested a review from a team as a code owner September 7, 2026 23:44
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.

pull_request_read get_files always returns full patches

1 participant