Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reduces list_issues response verbosity by converting GraphQL issue fragments directly into MinimalIssue and returning a typed, paginated MinimalIssuesResponse, avoiding intermediate *github.Issue objects.
Changes:
- Added
MinimalIssuesResponseand conversion helpers to produce a minimal, typed paginated response for issues. - Switched
list_issuesto marshal the new minimal response instead of raw GitHub issue objects + hand-built pagination map. - Updated
MinimalIssueJSON tags (html_urlnowomitempty) and adjustedTest_ListIssuesto unmarshal the new response type.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| pkg/github/minimal_types.go | Introduces MinimalIssuesResponse plus fragment-to-minimal conversion to reduce output size and flatten labels. |
| pkg/github/issues.go | Removes fragmentToIssue and updates list_issues to return MinimalIssuesResponse via MarshalledTextResult. |
| pkg/github/issues_test.go | Updates Test_ListIssues to unmarshal MinimalIssuesResponse and validates basic issue fields. |
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
Reduces context usage for
list_issuesby converting GraphQL fragments directly toMinimalIssue, and introducing a typedMinimalIssuesResponsefor the paginated response (following theMinimalReviewThreadsResponsepattern). Also removes the intermediatefragmentToIssueconversion.Token reduction is modest since the GraphQL fragment was already sparse, the main wins are labels flattened to name strings and
iddropped.Fields preserved
number,title,body,state,user(login),labels(name strings),comments,created_at,updated_atFields dropped
id,Label'snode_idanddescription(labels flattened to[]string)Single Item Payload Diff
Before
{ "id": 3985464387, "number": 2082, "state": "OPEN", "title": "Duplicate CodeQL", "body": "### Describe the bug\n\nA clear and concise description of what the bug is.\n\n### Affected version\n\nPlease run ` docker run -i --rm ghcr.io/github/github-mcp-server ./github-mcp-server --version` and paste the output below\n\n### Steps to reproduce the behavior\n\n1. Type this \u0026#39;...\u0026#39;\n2. View the output \u0026#39;....\u0026#39;\n3. See error\n\n### Expected vs actual behavior\n\nA clear and concise description of what you expected to happen and what actually happened.\n\n### Logs\n\nPaste any available logs. Redact if needed.\n", "user": { "login": "kdehl16-web" }, "labels": [ { "name": "bug", "description": "Something isn't working", "node_id": "LA_kwDOODGMVM8AAAAB6zaIbw" }, { "name": "request ai review", "description": "", "node_id": "LA_kwDOODGMVM8AAAACVGXp_w" } ], "comments": 0, "created_at": "2026-02-24T19:32:40Z", "updated_at": "2026-02-24T19:32:51Z" }After
{ "number": 2082, "title": "Duplicate CodeQL", "body": "### Describe the bug\n\nA clear and concise description of what the bug is.\n\n### Affected version\n\nPlease run ` docker run -i --rm ghcr.io/github/github-mcp-server ./github-mcp-server --version` and paste the output below\n\n### Steps to reproduce the behavior\n\n1. Type this \u0026#39;...\u0026#39;\n2. View the output \u0026#39;....\u0026#39;\n3. See error\n\n### Expected vs actual behavior\n\nA clear and concise description of what you expected to happen and what actually happened.\n\n### Logs\n\nPaste any available logs. Redact if needed.\n", "state": "OPEN", "user": { "login": "kdehl16-web" }, "labels": ["bug", "request ai review"], "created_at": "2026-02-24T19:32:40Z", "updated_at": "2026-02-24T19:32:51Z" }Token Reduction
Measured using a script that makes use of OAI's tiktoken library (o200k_base) at 2 and 100 items. The web version can be found here.
Why
list_issueswas converting GraphQL fragments to raw*github.Issueobjects (viafragmentToIssue), then serialising those with fullLabelobjects and hand built pagination info. This replaces both with typed minimal types.What changed
MinimalIssuesResponsestruct andconvertToMinimalIssuesResponsefunction (which followsMinimalReviewThreadsResponsepattern)fragmentToMinimalIssuewhich converts GraphQL fragment directly toMinimalIssue, skipping the intermediate*github.IssueMinimalPageInfoand response wrapper structs to camelCase tags (pageInfo,totalCount,hasNextPage, etc.) consistent with how all tools handlers return pagination metadata. This affectsMinimalReviewThreadsResponsewhich was the only outlier using snake_caseomitemptytoMinimalIssue.HTMLURL(not populated by the GraphQL fragment)MCP impact
Prompts tested (tool changes only)
List the last 2 issues in github/github-mcp-serverList the last 100 issues in github/github-mcp-serverSecurity / limits
Tool renaming
deprecated_tool_aliases.goNote: 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
./script/lint./script/testDocs