Skip to content

Commit 8ebb834

Browse files
committed
rRename get_my_teams to get_teams and update documentation and tests
1 parent 8bc6489 commit 8ebb834

File tree

5 files changed

+30
-13
lines changed

5 files changed

+30
-13
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,8 +421,8 @@ The following sets of tools are available (all are on by default):
421421
- **get_me** - Get my user profile
422422
- No parameters required
423423

424-
- **get_my_teams** - Get my teams
425-
- No parameters required
424+
- **get_teams** - Get my teams
425+
- `user`: Username to get teams for. If not provided, uses the authenticated user. (string, optional)
426426

427427
</details>
428428

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"annotations": {
3+
"title": "Get my teams",
4+
"readOnlyHint": true
5+
},
6+
"description": "Get details of the teams the authenticated user is a member of.",
7+
"inputSchema": {
8+
"properties": {
9+
"user": {
10+
"description": "Username to get teams for. If not provided, uses the authenticated user.",
11+
"type": "string"
12+
}
13+
},
14+
"type": "object"
15+
},
16+
"name": "get_teams"
17+
}

pkg/github/context_tools.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,14 @@ func GetMe(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Too
9393
return tool, handler
9494
}
9595

96-
func GetMyTeams(getClient GetClientFn, getGQLClient GetGQLClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc) {
97-
tool := mcp.NewTool("get_my_teams",
98-
mcp.WithDescription(t("TOOL_GET_MY_TEAMS_DESCRIPTION", "Get details of the teams the authenticated user is a member of.")),
96+
func GetTeams(getClient GetClientFn, getGQLClient GetGQLClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc) {
97+
tool := mcp.NewTool("get_teams",
98+
mcp.WithDescription(t("TOOL_GET_TEAMS_DESCRIPTION", "Get details of the teams the authenticated user is a member of.")),
9999
mcp.WithString("user",
100-
mcp.Description(t("TOOL_GET_MY_TEAMS_USER_DESCRIPTION", "Username to get teams for. If not provided, uses the authenticated user.")),
100+
mcp.Description(t("TOOL_GET_TEAMS_USER_DESCRIPTION", "Username to get teams for. If not provided, uses the authenticated user.")),
101101
),
102102
mcp.WithToolAnnotation(mcp.ToolAnnotation{
103-
Title: t("TOOL_GET_MY_TEAMS_TITLE", "Get my teams"),
103+
Title: t("TOOL_GET_TEAMS_TITLE", "Get my teams"),
104104
ReadOnlyHint: ToBoolPtr(true),
105105
}),
106106
)

pkg/github/context_tools_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,14 @@ func Test_GetMe(t *testing.T) {
143143
}
144144
}
145145

146-
func Test_GetMyTeams(t *testing.T) {
146+
func Test_GetTeams(t *testing.T) {
147147
t.Parallel()
148148

149-
tool, _ := GetMyTeams(nil, nil, translations.NullTranslationHelper)
149+
tool, _ := GetTeams(nil, nil, translations.NullTranslationHelper)
150150
require.NoError(t, toolsnaps.Test(tool.Name, tool))
151151

152-
assert.Equal(t, "get_my_teams", tool.Name)
153-
assert.True(t, *tool.Annotations.ReadOnlyHint, "get_my_teams tool should be read-only")
152+
assert.Equal(t, "get_teams", tool.Name)
153+
assert.True(t, *tool.Annotations.ReadOnlyHint, "get_teams tool should be read-only")
154154

155155
mockUser := &github.User{
156156
Login: github.Ptr("testuser"),
@@ -333,7 +333,7 @@ func Test_GetMyTeams(t *testing.T) {
333333

334334
for _, tc := range tests {
335335
t.Run(tc.name, func(t *testing.T) {
336-
_, handler := GetMyTeams(tc.stubbedGetClientFn, tc.stubbedGetGQLClientFn, translations.NullTranslationHelper)
336+
_, handler := GetTeams(tc.stubbedGetClientFn, tc.stubbedGetGQLClientFn, translations.NullTranslationHelper)
337337

338338
request := createMCPRequest(tc.requestArgs)
339339
result, err := handler(context.Background(), request)

pkg/github/tools.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG
162162
contextTools := toolsets.NewToolset("context", "Tools that provide context about the current user and GitHub context you are operating in").
163163
AddReadTools(
164164
toolsets.NewServerTool(GetMe(getClient, t)),
165-
toolsets.NewServerTool(GetMyTeams(getClient, getGQLClient, t)),
165+
toolsets.NewServerTool(GetTeams(getClient, getGQLClient, t)),
166166
)
167167

168168
gists := toolsets.NewToolset("gists", "GitHub Gist related tools").

0 commit comments

Comments
 (0)