Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Reduce fields insearch_users response#485

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
SamMorrowDrums merged 1 commit intomainfromcleanup-search-users
Jun 6, 2025

Conversation

@SamMorrowDrums
Copy link
Collaborator

There is little use in most of the fields returned by thesearch_users function, 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.

image

Here is an example showing that the "missing" data is easily re-constructed by the LLM:

image

CopilotAI review requested due to automatic review settingsJune 5, 2025 22:11
@SamMorrowDrumsSamMorrowDrums requested a review froma team as acode ownerJune 5, 2025 22:11
Copy link
Contributor

CopilotAI left a 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 streamlines thesearch_users tool output by returning only essential fields (login, ID, profile URL, avatar URL), injects atype:user filter into the query, and updates the tests to match the new minimal response format.

  • AddedMinimalUser andMinimalSearchUsersResult types and conversion logic insearch.go
  • Automatically prepended"type:user " to the search query
  • Updated test assertions insearch_test.go to useMinimalSearchUsersResult and renamed fields

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

FileDescription
pkg/github/search.goDefined minimal response structs, converted full result to minimal, and prefixed"type:user" to queries
pkg/github/search_test.goSwitched tests to unmarshal intoMinimalSearchUsersResult, updated query expectations and field assertions
Comments suppressed due to low confidence (2)

pkg/github/search.go:152

  • [nitpick] The JSON fieldprofile_url diverges from GitHub’s standardhtml_url; consider renaming the struct field toHTMLURL withjson:"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 aboveMinimalUser (and similarly forMinimalSearchUsersResult) to explain its purpose and list which fields are intentionally omitted, improving clarity for future maintainers.
type MinimalUser struct {

@SamMorrowDrums
Copy link
CollaboratorAuthor

@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.

@SamMorrowDrumsSamMorrowDrums merged commit9dd6fc5 intomainJun 6, 2025
16 checks passed
@SamMorrowDrumsSamMorrowDrums deleted the cleanup-search-users branchJune 6, 2025 09:24
nickytonline pushed a commit to nickytonline/github-mcp-http that referenced this pull requestOct 4, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

Copilot code reviewCopilotCopilot left review comments

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@SamMorrowDrums

[8]ページ先頭

©2009-2025 Movatter.jp