-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Add minimal response to CRUD tools, repositories
and search
toolsets
#988
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
repositories
and search
toolsets
repositories
and search
toolsetsrepositories
and search
toolsets
Great work! I have not been much involved in the recent discussions about the size of tool call responses, but do you think instead of selectively picking specific tools and downsizing their response we could do:
Something reusable for every other tool where the api response is unnecessary long. So kinda stays the same as this pr, only now they can fall back to the old/full response if they need to. |
Co-authored-by: Lulu <[email protected]>
Co-authored-by: Lulu <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds minimal response options to various GitHub MCP tools to reduce output verbosity. The changes introduce optional parameters to return concise responses instead of full GitHub API objects, addressing the need for more efficient data transfer in MCP tools.
- Added
minimal_output
parameter tosearch_repositories
(default: true) andinclude_diff
parameter toget_commit
(default: true) - Modified list operations (
list_commits
,list_branches
) to return minimal objects by default - Updated CRUD operations to return only URLs in minimal response format
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
pkg/github/server.go | Added OptionalBoolParamWithDefault helper function |
pkg/github/search.go | Added minimal output option to repository search |
pkg/github/repositories.go | Updated commit and branch operations to use minimal responses |
pkg/github/pullrequests.go | Modified PR CRUD operations to return minimal responses |
pkg/github/issues.go | Updated issue CRUD operations to return minimal responses |
pkg/github/gists.go | Modified gist CRUD operations to return minimal responses |
pkg/github/minimal_types.go | Added new minimal response type definitions |
Test files | Updated tests to verify minimal response formats |
Documentation | Updated README and tool snapshots with new parameters |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <[email protected]>
Estimated output length savingsToken counts provided with OpenAI tokenizer for reference, but proporional savings will be similar across models. List Commits (5.2x){
"owner": "github",
"repo": "github-mcp-server",
"sha": "e72c1430debb8b0410cbaa9ba0a0cae33adae91a"
} New: 7,673 tokens[
...,
{
"sha": "586a0d6591a9b408890c39195e36dccccd3d7e40",
"html_url": "https://github.com/github/github-mcp-server/commit/586a0d6591a9b408890c39195e36dccccd3d7e40",
"commit": {
"message": "Update pkg/github/repositories.go\n\nCo-authored-by: Copilot \u003c[email protected]\u003e",
"author": {
"name": "Matt Holloway",
"email": "[email protected]",
"date": "2025-09-01T16:31:51Z"
},
"committer": {
"name": "GitHub",
"email": "[email protected]",
"date": "2025-09-01T16:31:51Z"
}
},
"author": {
"login": "mattdholloway",
"id": 918573,
"profile_url": "https://github.com/mattdholloway",
"avatar_url": "https://avatars.githubusercontent.com/u/918573?v=4"
},
"committer": {
"login": "web-flow",
"id": 19864447,
"profile_url": "https://github.com/web-flow",
"avatar_url": "https://avatars.githubusercontent.com/u/19864447?v=4"
}
},
...
] Old: 39,860 tokens[
...
{
"node_id": "C_kwDOODGMVNoAKDU4NmEwZDY1OTFhOWI0MDg4OTBjMzkxOTVlMzZkY2NjY2QzZDdlNDA",
"sha": "586a0d6591a9b408890c39195e36dccccd3d7e40",
"commit": {
"author": {
"date": "2025-09-01T16:31:51Z",
"name": "Matt Holloway",
"email": "[email protected]"
},
"committer": {
"date": "2025-09-01T16:31:51Z",
"name": "GitHub",
"email": "[email protected]"
},
"message": "Update pkg/github/repositories.go\n\nCo-authored-by: Copilot \u003c[email protected]\u003e",
"tree": { "sha": "415f5817de2ecbafcaddc7bf709482b875cb6f45" },
"url": "https://api.github.com/repos/github/github-mcp-server/git/commits/586a0d6591a9b408890c39195e36dccccd3d7e40",
"verification": {
"verified": true,
"reason": "valid",
"signature": "-----BEGIN PGP SIGNATURE-----\n\nwsFcBAABCAAQBQJotcp3CRC1aQ7uu5UhlAAAZ3UQAB5FlbZqLwFWX6kfDb7i10Gk\n6oIi1lXRUo1fhB3JbwzQXIXQJL8vVxCG7DzDl9z+PX+1yCrRR1pr/Yo3zd01MLoy\n4XWrrBxXhX4LUoniBDpckIG003+l2uvTl9p2gGuzV9R4awFpoDm47zVD4oj2wJzp\ngbiW7DTnsqQ9/EDxeMJe41HsC1VFvEUatv20y7mqne6xLDKYXRNLJ0ZJPn9B1x3E\n1R1XGxlTBXMgkdxM0D0lJuiZLolCnPKH8PuXAFQ0SHeaGmjfHdg6wj4uW2uK2Ri8\neATJfTWI48oCll78bZgcfwJlHE++pDt8wgZmBNNKdgqes/jJ2vsW+7qggrw8hA63\nZBYNG2Szlg0r2N9cO1oKz8gP3o/jMUknXf+9SQFYg7+oI2s+MIPfUGuKUds1EZHB\n664CKF8SPFXzY+9OxMkMfQNuRunkfgRRksEpPMdygeVD8FFIEk1fW16hRzIvDvW3\n6qiMiBJDJNzEG4hfKM3VpNqom18qSPupLlHU3BgBVWE0bcBCdxlgnJ4THX4bgDx6\ne7hF7Za9BgRvUhnyaZjozh65grl/HyKSD81JJNeDdSgKL9Yee9TLu3OsLbXMLEf2\nqqcqn3vFQCvK/AziQd+vj+9SLnmiDSKlIOlE6ywhZwp7dMDMaT8WlnExF7FlYh4I\nqKSQCxuMcJS/visAK9Fe\n=ZNXS\n-----END PGP SIGNATURE-----\n",
"payload": "tree 415f5817de2ecbafcaddc7bf709482b875cb6f45\nparent cfeed3d5e3095f0de2de2e4916d867a7379f98fb\nauthor Matt Holloway \u003c[email protected]\u003e 1756744311 +0100\ncommitter GitHub \u003c[email protected]\u003e 1756744311 +0100\n\nUpdate pkg/github/repositories.go\n\nCo-authored-by: Copilot \u003c[email protected]\u003e"
},
"comment_count": 0
},
"author": {
"login": "mattdholloway",
"id": 918573,
"node_id": "MDQ6VXNlcjkxODU3Mw==",
"avatar_url": "https://avatars.githubusercontent.com/u/918573?v=4",
"html_url": "https://github.com/mattdholloway",
"gravatar_id": "",
"type": "User",
"site_admin": true,
"url": "https://api.github.com/users/mattdholloway",
"events_url": "https://api.github.com/users/mattdholloway/events{/privacy}",
"following_url": "https://api.github.com/users/mattdholloway/following{/other_user}",
"followers_url": "https://api.github.com/users/mattdholloway/followers",
"gists_url": "https://api.github.com/users/mattdholloway/gists{/gist_id}",
"organizations_url": "https://api.github.com/users/mattdholloway/orgs",
"received_events_url": "https://api.github.com/users/mattdholloway/received_events",
"repos_url": "https://api.github.com/users/mattdholloway/repos",
"starred_url": "https://api.github.com/users/mattdholloway/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mattdholloway/subscriptions"
},
"committer": {
"login": "web-flow",
"id": 19864447,
"node_id": "MDQ6VXNlcjE5ODY0NDQ3",
"avatar_url": "https://avatars.githubusercontent.com/u/19864447?v=4",
"html_url": "https://github.com/web-flow",
"gravatar_id": "",
"type": "User",
"site_admin": false,
"url": "https://api.github.com/users/web-flow",
"events_url": "https://api.github.com/users/web-flow/events{/privacy}",
"following_url": "https://api.github.com/users/web-flow/following{/other_user}",
"followers_url": "https://api.github.com/users/web-flow/followers",
"gists_url": "https://api.github.com/users/web-flow/gists{/gist_id}",
"organizations_url": "https://api.github.com/users/web-flow/orgs",
"received_events_url": "https://api.github.com/users/web-flow/received_events",
"repos_url": "https://api.github.com/users/web-flow/repos",
"starred_url": "https://api.github.com/users/web-flow/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/web-flow/subscriptions"
},
"parents": [
{
"sha": "cfeed3d5e3095f0de2de2e4916d867a7379f98fb",
"html_url": "https://github.com/github/github-mcp-server/commit/cfeed3d5e3095f0de2de2e4916d867a7379f98fb",
"url": "https://api.github.com/repos/github/github-mcp-server/commits/cfeed3d5e3095f0de2de2e4916d867a7379f98fb"
}
],
"html_url": "https://github.com/github/github-mcp-server/commit/586a0d6591a9b408890c39195e36dccccd3d7e40",
"url": "https://api.github.com/repos/github/github-mcp-server/commits/586a0d6591a9b408890c39195e36dccccd3d7e40",
"comments_url": "https://api.github.com/repos/github/github-mcp-server/commits/586a0d6591a9b408890c39195e36dccccd3d7e40/comments"
},
...
] List Branches (4.1x){
"owner": "github",
"repo": "github-mcp-server"
} New: 1,373 tokens[
...,
{
"name": "SamMorrowDrums-patch-1",
"sha": "884c0e66eee260e1bbd58e1470311d66764a2bc5",
"protected": true
},
...
] Old: 5,606 tokens[
...,
{
"name": "SamMorrowDrums-patch-1",
"commit": {
"sha": "884c0e66eee260e1bbd58e1470311d66764a2bc5",
"url": "https://api.github.com/repos/github/github-mcp-server/commits/884c0e66eee260e1bbd58e1470311d66764a2bc5"
},
"protected": true,
"protection": {
"required_status_checks": {
"strict": false,
"contexts": [],
"checks": []
},
"required_pull_request_reviews": null,
"enforce_admins": null,
"restrictions": null,
"required_linear_history": null,
"allow_force_pushes": null,
"allow_deletions": null,
"required_conversation_resolution": null
},
"protection_url": "https://api.github.com/repos/github/github-mcp-server/branches/SamMorrowDrums-patch-1/protection"
},
... Create Issue (34.3x*)* highly variable depending on issue body length {
"owner": "lulubeatson",
"repo": "ghmcp-test",
"title": "Add a pun to the README",
"body": "## Description\nThe README could use some humor! Let's add a pun to make it more engaging and fun to read.\n\n## Acceptance Criteria\n- [ ] Add a clever pun related to the repository or its purpose\n- [ ] Ensure the pun fits naturally within the existing README content\n- [ ] Keep it appropriate and professional\n\n## Suggestions\nSome ideas for puns:\n- Something related to GitHub/Git (e.g., \"This repo is commit-ted to excellence!\")\n- Something about testing or development\n- A play on words related to the project name\n\n## Priority\nLow - this is a fun enhancement to improve the developer experience"
} New: 20 tokens{"url":"https://github.com/LuluBeatson/ghmcp-test/issues/28"} Old: 685 tokens{"id":3373361799,"number":27,"state":"open","locked":false,"title":"Add a pun to the README","body":"## Description\nThe README could use some humor! Let's add a pun to make it more engaging and fun to read.\n\n## Acceptance Criteria\n- [ ] Add a clever pun related to the repository or its purpose\n- [ ] Ensure the pun fits naturally within the existing README content\n- [ ] Keep it appropriate and professional\n\n## Suggestions\nSome ideas for puns:\n- Something related to GitHub/Git (e.g., \"This repo is commit-ted to excellence!\")\n- Something about testing or development\n- A play on words related to the project name\n\n## Priority\nLow - this is a fun enhancement to improve the developer experience","author_association":"OWNER","user":{"login":"LuluBeatson","id":59149422,"node_id":"MDQ6VXNlcjU5MTQ5NDIy","avatar_url":"https://avatars.githubusercontent.com/u/59149422?v=4","html_url":"https://github.com/LuluBeatson","gravatar_id":"","type":"User","site_admin":true,"url":"https://api.github.com/users/LuluBeatson","events_url":"https://api.github.com/users/LuluBeatson/events{/privacy}","following_url":"https://api.github.com/users/LuluBeatson/following{/other_user}","followers_url":"https://api.github.com/users/LuluBeatson/followers","gists_url":"https://api.github.com/users/LuluBeatson/gists{/gist_id}","organizations_url":"https://api.github.com/users/LuluBeatson/orgs","received_events_url":"https://api.github.com/users/LuluBeatson/received_events","repos_url":"https://api.github.com/users/LuluBeatson/repos","starred_url":"https://api.github.com/users/LuluBeatson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LuluBeatson/subscriptions"},"comments":0,"created_at":"2025-09-01T17:12:58Z","updated_at":"2025-09-01T17:12:58Z","url":"https://api.github.com/repos/LuluBeatson/ghmcp-test/issues/27","html_url":"https://github.com/LuluBeatson/ghmcp-test/issues/27","comments_url":"https://api.github.com/repos/LuluBeatson/ghmcp-test/issues/27/comments","events_url":"https://api.github.com/repos/LuluBeatson/ghmcp-test/issues/27/events","labels_url":"https://api.github.com/repos/LuluBeatson/ghmcp-test/issues/27/labels{/name}","repository_url":"https://api.github.com/repos/LuluBeatson/ghmcp-test","reactions":{"total_count":0,"+1":0,"-1":0,"laugh":0,"confused":0,"heart":0,"hooray":0,"rocket":0,"eyes":0,"url":"https://api.github.com/repos/LuluBeatson/ghmcp-test/issues/27/reactions"},"node_id":"I_kwDOPNjcb87JEWqH"} |
…ets (github#988) * add comprehensive minimal response where appropriate * remove unneeded comments * remove incorrect diff param * update docs * rm comment * Update pkg/github/repositories.go Co-authored-by: Lulu <[email protected]> * update toolsnaps and docs * change minimal_output to use new OptionalBoolParamWithDefault * Update pkg/github/repositories.go Co-authored-by: Lulu <[email protected]> * refactor minimal conversion funcs to minimal_types.go * consolidate response structs and remove unneeded message field * consolidate response further * remove CloneURL field * Update pkg/github/repositories.go Co-authored-by: Copilot <[email protected]> * Update pkg/github/server.go Co-authored-by: Copilot <[email protected]> * fix undefined * change incorrect comment * remove old err var declaration * Update pkg/github/repositories.go Co-authored-by: Copilot <[email protected]> * fix syntax issue * update toolsnaps --------- Co-authored-by: Lulu <[email protected]> Co-authored-by: Copilot <[email protected]>
* docs: Add Google Gemini CLI installation guide and integration - Add comprehensive installation guide for Google Gemini CLI - Include Docker and binary configuration options - Add authentication setup for Gemini API and Vertex AI - Update main README.md to include Gemini CLI in installation guides - Update installation guides index with Gemini CLI entry and support matrix - Follow established documentation patterns and security best practices * Fix Gemini CLI command syntax and add remote server method - Replace all 'gemini-cli' commands with correct 'gemini' syntax - Fix verification commands to use '/mcp list' and '/tools' prompts - Add httpUrl remote server method as primary configuration option - Update config file paths from settings.json to config.json - Correct npx installation command syntax - Add link to official Gemini CLI documentation Addresses feedback from soisyourface in PR review. * Emphasize official Gemini CLI documentation link Reduce detailed installation steps and direct users to official docs for up-to-date instructions, addressing reviewer feedback about maintainability. * Fix Gemini CLI configuration file name: config.json -> settings.json The correct configuration file for Gemini CLI is settings.json, not config.json. This applies to both global (~/.gemini/settings.json) and project-specific (.gemini/settings.json) configurations as confirmed by official documentation. * Remove Gemini CLI installation and authentication sections Removed lines 11-41 containing Gemini CLI installation commands and authentication setup instructions. * Add Podman as Docker alternative in prerequisites Added Podman as container engine option alongside Docker. * Remove references to deprecated npm package * Add comprehensive ~/.gemini/.env file example * Fix authorization header to use literal token placeholder Environment variable substitution in headers is not yet supported by Gemini CLI (see google-gemini/gemini-cli#5282). * Add issue types (#869) * feat: add type to issues * test: add `type` test for create and update issues * Generate docs and toolsnaps * Update pkg/github/issues.go Co-authored-by: Copilot <[email protected]> * Use github ptr --------- Co-authored-by: Pranav RK <[email protected]> Co-authored-by: Pranav RK <[email protected]> Co-authored-by: Alon Kenneth <[email protected]> Co-authored-by: Copilot <[email protected]> * Enable Dependabot (#654) * Create/Update dependabot.yaml * Apply suggestion from @Copilot Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]> * Bump SDK version to 0.36.0 (#863) * Use server.ServerResourceTemplate and server.ServerPrompt wrappers (#886) * Update "Close inactive issues" workflow to close issues after 180 days of inactivity (#909) * update PR_DAYS_BEFORE_STALE * update to mark as stale after 60 days * Update Claude MCP install guide after testing (#706) * Revise Claude installation guide - Verified Claude Code installation steps - Identified and documented issues with Claude Desktop setup - Updated installation documentation based on testing * Revise instructions for opening Claude Code Updated recommendations for opening Claude Code. * Update docs/installation-guides/install-claude.md Co-authored-by: Copilot <[email protected]> * Update docs/installation-guides/install-claude.md Co-authored-by: Copilot <[email protected]> * Update installation guide for Claude setup Added installation option for using Claude Code using a release binary. * Change section title for Go Binary installation Updated section title for clarity regarding installation without Docker. * Close double quote in bash command --------- Co-authored-by: Copilot <[email protected]> Co-authored-by: LuluBeatson <[email protected]> Co-authored-by: Matt Holloway <[email protected]> Co-authored-by: Tommaso Moro <[email protected]> * Add actions job log buffer and profiler (#866) * add sliding window for actions logs * refactor: fix sliding * remove trim content * only use up to 1mb of memory for logs * update to tail lines in second pass * add better memory usage calculation * increase window size to 5MB * update test * update vers * undo vers change * add incremental memory tracking * use ring buffer * remove unused ctx param * remove manual GC clear * fix cca feedback * extract ring buffer logic to new package * handle log content processing errors and use correct param for maxjobloglines * fix tailing * account for if tailLines exceeds window size * add profiling thats reusable * remove profiler testing * refactor profiler: introduce safeMemoryDelta for accurate memory delta calculations * linter fixes * Update pkg/buffer/buffer.go Co-authored-by: Copilot <[email protected]> * use flag for maxJobLogLines * add param passing for context window size * refactor: rename contextWindowSize to contentWindowSize for consistency * fix: use tailLines if bigger but only if <= 5000 * fix: limit tailLines to a maximum of 500 for log content download * Update cmd/github-mcp-server/main.go Co-authored-by: Adam Holt <[email protected]> * Update cmd/github-mcp-server/main.go Co-authored-by: Adam Holt <[email protected]> * move profiler to internal/ * update actions test with new profiler location * fix: adjust buffer size limits * make line buffer 1028kb * fix mod path * change test to use same buffer size as normal use * improve test for non-sliding window implementation to not count empty lines * make test memory measurement more accurate * remove impossible conditional --------- Co-authored-by: Copilot <[email protected]> Co-authored-by: Adam Holt <[email protected]> * Add get_release_by_tag tool (#938) * add get_release_by_tag tool * add tool * add tests * autogen * remove comment * docs(readme): Update readme to point to correct installation guides index (#892) * docs(readme): Update readme to point to correct installation guides index * feat(contributors): add list_repository_contributors tool * Revert "feat(contributors): add list_repository_contributors tool" This reverts commit ece480e. --------- Co-authored-by: Tommaso Moro <[email protected]> * Add Global Security Advisories Toolset (#919) * Repository security advisories (#925) * Add support for listing repo level security advisories * Add support for listing repo security advisories at the org level * Update Cursor installation link (#940) * use new link * update local install link * Change role from "system" to "user" in prompt messages for `AssignCodingAgentPrompt` and `IssueToFixWorkflowPrompt`. Role "system" is not allowed by Claude Code in MCP provided prompt (allowed only role "user" and "assistant") (#941) Co-authored-by: 0xGosu <[email protected]> * Local MCP is supported * Refactor Gemini CLI install guide * Remove Bearer from Authorization header * Add reference to main README for latest config * Bearer needed for headers, add references * Add minimal response to CRUD tools, `repositories` and `search` toolsets (#988) * add comprehensive minimal response where appropriate * remove unneeded comments * remove incorrect diff param * update docs * rm comment * Update pkg/github/repositories.go Co-authored-by: Lulu <[email protected]> * update toolsnaps and docs * change minimal_output to use new OptionalBoolParamWithDefault * Update pkg/github/repositories.go Co-authored-by: Lulu <[email protected]> * refactor minimal conversion funcs to minimal_types.go * consolidate response structs and remove unneeded message field * consolidate response further * remove CloneURL field * Update pkg/github/repositories.go Co-authored-by: Copilot <[email protected]> * Update pkg/github/server.go Co-authored-by: Copilot <[email protected]> * fix undefined * change incorrect comment * remove old err var declaration * Update pkg/github/repositories.go Co-authored-by: Copilot <[email protected]> * fix syntax issue * update toolsnaps --------- Co-authored-by: Lulu <[email protected]> Co-authored-by: Copilot <[email protected]> * initial org repo create support (#1023) --------- Co-authored-by: JoannaaKL <[email protected]> Co-authored-by: Pranav RK <[email protected]> Co-authored-by: Pranav RK <[email protected]> Co-authored-by: Alon Kenneth <[email protected]> Co-authored-by: Copilot <[email protected]> Co-authored-by: Zack Koppert <[email protected]> Co-authored-by: Ksenia Bobrova <[email protected]> Co-authored-by: Tommaso Moro <[email protected]> Co-authored-by: Dimitrios Philliou <[email protected]> Co-authored-by: LuluBeatson <[email protected]> Co-authored-by: Matt Holloway <[email protected]> Co-authored-by: Adam Holt <[email protected]> Co-authored-by: Rebecca Biju <[email protected]> Co-authored-by: Jurre <[email protected]> Co-authored-by: 0xGosu <[email protected]> Co-authored-by: Lulu <[email protected]>
This aims to reduce the output from the 'worst offending' MCP tools for response length. The main changes are the introduction of new minimal types for API responses, updates to CRUD handlers to use these minimal types, and enhancements to search and commit tools for more configurable output. These changes simplify responses and make the API easier to consume for clients that only need essential information.
Tools Modified
Search and Listing Tools (Added Parameters)
search_repositories - Added
minimal_output
parameter (default: true) to return minimal repository information instead of full GitHub API objectsget_commit - Added
include_diff
parameter (default: true) to optionally include file diffs and stats in the responseList Tools (Modified to Return Minimal Objects)
list_commits - Modified to return minimal commit objects with essential fields only
list_branches - Modified to return minimal branch objects (name, SHA, protected status)
CRUD Tools (Modified to Return URL-Only Response)
create_repository - Modified to return minimal response containing only the repository URL
fork_repository - Modified to return minimal response containing only the repository URL
create_pull_request - Modified to return minimal response containing only the pull request URL
update_pull_request - Modified to return minimal response containing only the pull request URL
create_issue - Modified to return minimal response containing only the issue URL
update_issue - Modified to return minimal response containing only the issue URL
create_gist - Modified to return minimal response containing only the gist URL
update_gist - Modified to return minimal response containing only the gist URL