@@ -2,13 +2,36 @@ package github
22
33import (
44 "context"
5+ "time"
56
67 ghErrors "github.com/github/github-mcp-server/pkg/errors"
78 "github.com/github/github-mcp-server/pkg/translations"
89 "github.com/mark3labs/mcp-go/mcp"
910 "github.com/mark3labs/mcp-go/server"
1011)
1112
13+ // UserDetails contains additional fields about a GitHub user not already
14+ // present in MinimalUser. Used by get_me context tool but omitted from search_users.
15+ type UserDetails struct {
16+ Name string `json:"name,omitempty"`
17+ Company string `json:"company,omitempty"`
18+ Blog string `json:"blog,omitempty"`
19+ Location string `json:"location,omitempty"`
20+ Email string `json:"email,omitempty"`
21+ Hireable bool `json:"hireable,omitempty"`
22+ Bio string `json:"bio,omitempty"`
23+ TwitterUsername string `json:"twitter_username,omitempty"`
24+ PublicRepos int `json:"public_repos"`
25+ PublicGists int `json:"public_gists"`
26+ Followers int `json:"followers"`
27+ Following int `json:"following"`
28+ CreatedAt time.Time `json:"created_at"`
29+ UpdatedAt time.Time `json:"updated_at"`
30+ PrivateGists int `json:"private_gists,omitempty"`
31+ TotalPrivateRepos int64 `json:"total_private_repos,omitempty"`
32+ OwnedPrivateRepos int64 `json:"owned_private_repos,omitempty"`
33+ }
34+
1235// GetMe creates a tool to get details of the authenticated user.
1336func GetMe (getClient GetClientFn , t translations.TranslationHelperFunc ) (mcp.Tool , server.ToolHandlerFunc ) {
1437 tool := mcp .NewTool ("get_me" ,
@@ -44,6 +67,25 @@ func GetMe(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Too
4467 ID : user .GetID (),
4568 ProfileURL : user .GetHTMLURL (),
4669 AvatarURL : user .GetAvatarURL (),
70+ Details : & UserDetails {
71+ Name : user .GetName (),
72+ Company : user .GetCompany (),
73+ Blog : user .GetBlog (),
74+ Location : user .GetLocation (),
75+ Email : user .GetEmail (),
76+ Hireable : user .GetHireable (),
77+ Bio : user .GetBio (),
78+ TwitterUsername : user .GetTwitterUsername (),
79+ PublicRepos : user .GetPublicRepos (),
80+ PublicGists : user .GetPublicGists (),
81+ Followers : user .GetFollowers (),
82+ Following : user .GetFollowing (),
83+ CreatedAt : user .GetCreatedAt ().Time ,
84+ UpdatedAt : user .GetUpdatedAt ().Time ,
85+ PrivateGists : user .GetPrivateGists (),
86+ TotalPrivateRepos : user .GetTotalPrivateRepos (),
87+ OwnedPrivateRepos : user .GetOwnedPrivateRepos (),
88+ },
4789 }
4890
4991 return MarshalledTextResult (minimalUser ), nil
0 commit comments