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
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.")),
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.")),
returnghErrors.NewGitHubGraphQLErrorResponse(ctx, "Failed to find teams", err), nil
175
169
}
176
170
177
-
for_, team:=rangeorg.Teams.Nodes {
178
-
orgTeams.Teams=append(orgTeams.Teams, TeamInfo{
179
-
Name: string(team.Name),
180
-
Slug: string(team.Slug),
181
-
Description: string(team.Description),
182
-
})
171
+
varorganizations []OrganizationTeams
172
+
for_, org:=rangeq.User.Organizations.Nodes {
173
+
orgTeams:=OrganizationTeams{
174
+
Login: string(org.Login),
175
+
Teams: make([]TeamInfo, 0, len(org.Teams.Nodes)),
176
+
}
177
+
178
+
for_, team:=rangeorg.Teams.Nodes {
179
+
orgTeams.Teams=append(orgTeams.Teams, TeamInfo{
180
+
Name: string(team.Name),
181
+
Slug: string(team.Slug),
182
+
Description: string(team.Description),
183
+
})
184
+
}
185
+
186
+
organizations=append(organizations, orgTeams)
183
187
}
184
188
185
-
organizations=append(organizations, orgTeams)
189
+
returnMarshalledTextResult(organizations), nil
186
190
}
187
-
188
-
returnMarshalledTextResult(organizations), nil
189
-
})
190
-
191
-
returntool, handler
192
191
}
193
192
194
193
funcGetTeamMembers(getGQLClientGetGQLClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc) {
195
-
tool:=mcp.NewTool("get_team_members",
196
-
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")),
197
-
mcp.WithString("org",
198
-
mcp.Description(t("TOOL_GET_TEAM_MEMBERS_ORG_DESCRIPTION", "Organization login (owner) that contains the team.")),
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.")),
0 commit comments