You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// GetMe creates a tool to get details of the authenticated user.
37
-
funcGetMe(getClientGetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc) {
38
-
tool:=mcp.NewTool("get_me",
39
-
mcp.WithDescription(t("TOOL_GET_ME_DESCRIPTION", "Get details of the authenticated GitHub user. Use this when a request is about the user's own profile for GitHub. Or when information is missing to build other tool calls.")),
40
-
mcp.WithToolAnnotation(mcp.ToolAnnotation{
38
+
funcGetMe(getClientGetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, mcp.ToolHandler) {
39
+
tool:= mcp.Tool{
40
+
Name: "get_me",
41
+
Description: t("TOOL_GET_ME_DESCRIPTION", "Get details of the authenticated GitHub user. Use this when a request is about the user's own profile for GitHub. Or when information is missing to build other tool calls."),
42
+
Annotations: &mcp.ToolAnnotations{
41
43
Title: t("TOOL_GET_ME_USER_TITLE", "Get my user profile"),
returnmcp.NewToolResultErrorFromErr("failed to get GitHub client", err), nil
51
+
returnutils.NewToolResultErrorFromErr("failed to get GitHub client", err), err
51
52
}
52
53
53
54
user, res, err:=client.Users.Get(ctx, "")
@@ -56,7 +57,7 @@ func GetMe(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Too
56
57
"failed to get user",
57
58
res,
58
59
err,
59
-
), nil
60
+
), err
60
61
}
61
62
62
63
// Create minimal user representation instead of returning full user object
@@ -103,21 +104,30 @@ type OrganizationTeams struct {
103
104
Teams []TeamInfo`json:"teams"`
104
105
}
105
106
106
-
funcGetTeams(getClientGetClientFn, getGQLClientGetGQLClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc) {
107
-
returnmcp.NewTool("get_teams",
108
-
mcp.WithDescription(t("TOOL_GET_TEAMS_DESCRIPTION", "Get details of the teams the user is a member of. Limited to organizations accessible with current credentials")),
109
-
mcp.WithString("user",
110
-
mcp.Description(t("TOOL_GET_TEAMS_USER_DESCRIPTION", "Username to get teams for. If not provided, uses the authenticated user.")),
111
-
),
112
-
mcp.WithToolAnnotation(mcp.ToolAnnotation{
107
+
funcGetTeams(getClientGetClientFn, getGQLClientGetGQLClientFn, t translations.TranslationHelperFunc) (mcp.Tool, mcp.ToolHandlerFor[map[string]any, any]) {
108
+
// return mcp.NewTool("get_teams",
109
+
// mcp.WithDescription(t("TOOL_GET_TEAMS_DESCRIPTION", "Get details of the teams the user is a member of. Limited to organizations accessible with current credentials")),
110
+
// mcp.WithString("user",
111
+
// mcp.Description(t("TOOL_GET_TEAMS_USER_DESCRIPTION", "Username to get teams for. If not provided, uses the authenticated user.")),
112
+
// ),
113
+
// mcp.WithToolAnnotation(mcp.ToolAnnotation{
114
+
// Title: t("TOOL_GET_TEAMS_TITLE", "Get teams"),
115
+
// ReadOnlyHint: ToBoolPtr(true),
116
+
// }),
117
+
// ),
118
+
return mcp.Tool{
119
+
Name: "get_teams",
120
+
Description: t("TOOL_GET_TEAMS_DESCRIPTION", "Get details of the teams the user is a member of. Limited to organizations accessible with current credentials"),
funcGetTeamMembers(getGQLClientGetGQLClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc) {
194
-
returnmcp.NewTool("get_team_members",
195
-
mcp.WithDescription(t("TOOL_GET_TEAM_MEMBERS_DESCRIPTION", "Get member usernames of a specific team in an organization. Limited to organizations accessible with current credentials")),
196
-
mcp.WithString("org",
197
-
mcp.Description(t("TOOL_GET_TEAM_MEMBERS_ORG_DESCRIPTION", "Organization login (owner) that contains the team.")),
funcGetTeamMembers(getGQLClientGetGQLClientFn, t translations.TranslationHelperFunc) (mcp.Tool, mcp.ToolHandlerFor[map[string]any, any]) {
204
+
return mcp.Tool{
205
+
Name: "get_team_members",
206
+
Description: t("TOOL_GET_TEAM_MEMBERS_DESCRIPTION", "Get member usernames of a specific team in an organization. Limited to organizations accessible with current credentials"),
207
+
Annotations: &mcp.ToolAnnotations{
205
208
Title: t("TOOL_GET_TEAM_MEMBERS_TITLE", "Get team members"),
0 commit comments