Content-Length: 323573 | pFad | http://github.com/github/github-mcp-server/pull/638/files/45aae1e73b466a6bfa2e99b6d3d5aea7cc852c82

CD get_me return concise user response by LuluBeatson · Pull Request #638 · github/github-mcp-server · GitHub
Skip to content

get_me return concise user response #638

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

Merged
merged 4 commits into from
Jul 4, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion pkg/github/context_tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,19 @@ func GetMe(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Too
), nil
}

return MarshalledTextResult(user), nil
// Create minimal user representation instead of returning full user object
minimalUser := MinimalUser{
Login: user.GetLogin(),
ID: user.GetID(),
}
if user.HTMLURL != nil {
minimalUser.ProfileURL = *user.HTMLURL
}
if user.AvatarURL != nil {
minimalUser.AvatarURL = *user.AvatarURL
}

return MarshalledTextResult(minimalUser), nil
})

return tool, handler
Expand Down
12 changes: 4 additions & 8 deletions pkg/github/context_tools_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,17 +117,13 @@ func Test_GetMe(t *testing.T) {
}

// Unmarshal and verify the result
var returnedUser github.User
var returnedUser MinimalUser
err = json.Unmarshal([]byte(textContent.Text), &returnedUser)
require.NoError(t, err)

// Verify user details
assert.Equal(t, *tc.expectedUser.Login, *returnedUser.Login)
assert.Equal(t, *tc.expectedUser.Name, *returnedUser.Name)
assert.Equal(t, *tc.expectedUser.Email, *returnedUser.Email)
assert.Equal(t, *tc.expectedUser.Bio, *returnedUser.Bio)
assert.Equal(t, *tc.expectedUser.HTMLURL, *returnedUser.HTMLURL)
assert.Equal(t, *tc.expectedUser.Type, *returnedUser.Type)
// Verify minimal user details
assert.Equal(t, *tc.expectedUser.Login, returnedUser.Login)
assert.Equal(t, *tc.expectedUser.HTMLURL, returnedUser.ProfileURL)
})
}
}








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/github/github-mcp-server/pull/638/files/45aae1e73b466a6bfa2e99b6d3d5aea7cc852c82

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy