Reduce fields in search_users response#485
Merged
SamMorrowDrums merged 1 commit intomainfrom Jun 6, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR streamlines the search_users tool output by returning only essential fields (login, ID, profile URL, avatar URL), injects a type:user filter into the query, and updates the tests to match the new minimal response format.
- Added
MinimalUserandMinimalSearchUsersResulttypes and conversion logic insearch.go - Automatically prepended
"type:user "to the search query - Updated test assertions in
search_test.goto useMinimalSearchUsersResultand renamed fields
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pkg/github/search.go | Defined minimal response structs, converted full result to minimal, and prefixed "type:user" to queries |
| pkg/github/search_test.go | Switched tests to unmarshal into MinimalSearchUsersResult, updated query expectations and field assertions |
Comments suppressed due to low confidence (2)
pkg/github/search.go:152
- [nitpick] The JSON field
profile_urldiverges from GitHub’s standardhtml_url; consider renaming the struct field toHTMLURLwithjson:"html_url"so consumers familiar with the API won’t be surprised.
ProfileURL string `json:"profile_url,omitempty"`
pkg/github/search.go:149
- [nitpick] Add a comment above
MinimalUser(and similarly forMinimalSearchUsersResult) to explain its purpose and list which fields are intentionally omitted, improving clarity for future maintainers.
type MinimalUser struct {
1495115 to
52d0bf0
Compare
52d0bf0 to
6c70992
Compare
Collaborator
Author
|
@williammartin and @toby I am going ahead with this for reasons I mentioned to Toby last night, but I checked and even if I ask for ordering by follower count we don't get it in the response, so think the published schema is maybe wrong for the search API? Other user APIs might well provide them. |
nickytonline
pushed a commit
to nickytonline/github-mcp-http
that referenced
this pull request
Oct 4, 2025
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.
There is little use in most of the fields returned by the
search_usersfunction, as they are reproducible easily by knowing the user handle, or not relevant. The profile URL is useful as it encourages the LLM to format the handle as a link, which is good, I think.Here is an example showing that the "missing" data is easily re-constructed by the LLM: