-
Notifications
You must be signed in to change notification settings - Fork 2k
Add get_teams
tool
#834
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
base: main
Are you sure you want to change the base?
Add get_teams
tool
#834
Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a new get_teams
tool to retrieve team membership information for GitHub users. The tool allows querying teams for either the authenticated user or a specified user.
- Adds
GetTeams
function that uses GraphQL to fetch team membership across organizations - Integrates the new tool into the default context toolset alongside the existing
get_me
tool - Includes comprehensive test coverage with multiple scenarios including error cases
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
pkg/github/tools.go | Registers the new GetTeams tool in the context toolset |
pkg/github/context_tools.go | Implements the GetTeams function with GraphQL query logic |
pkg/github/context_tools_test.go | Adds comprehensive test suite for the new GetTeams tool |
pkg/github/toolsnaps/get_teams.snap | Tool schema snapshot for testing |
README.md | Documents the new get_teams tool in the available tools section |
"login": githubv4.String(username), | ||
} | ||
if err := gqlClient.Query(ctx, &q, vars); err != nil { | ||
return mcp.NewToolResultError(err.Error()), nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving forward, for errors from the GitHub GraphQL clients we return NewGitHubGraphQLErrorResponse
. More info can be found in ./docs/error-handling.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unsure of whether an error for initialising the client itself should be classed as the error type from a GraphQL query - other toolsets such as discussions seem to follow this pattern as well
Closes: https://github.com/github/copilot-agent-services/issues/270