chore: separate toolset creation from init and use typed error#487
Merged
SamMorrowDrums merged 1 commit intomainfrom Jun 6, 2025
Merged
chore: separate toolset creation from init and use typed error#487SamMorrowDrums merged 1 commit intomainfrom
SamMorrowDrums merged 1 commit intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a typed error for missing toolsets and decouples toolset creation from enabling so callers can compose and enable toolsets separately.
- Add
ToolsetDoesNotExistError, replacefmt.Errorfwith the new error type, and implementGetToolset(). - Update tests to assert against the typed error and add new coverage for
GetToolset. - Rename
InitToolsetstoDefaultToolsetGroupin GitHub integration and move enabling logic into the server initialization.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pkg/toolsets/toolsets.go | Added ToolsetDoesNotExistError, new GetToolset, replaced error strings |
| pkg/toolsets/toolsets_test.go | Updated tests to use errors.Is against the typed error, added TestToolsetGroup_GetToolset |
| pkg/github/tools.go | Renamed InitToolsets → DefaultToolsetGroup, removed inline enabling |
| internal/ghmcp/server.go | Changed server init to call EnableToolsets after creating the group |
Comments suppressed due to low confidence (2)
pkg/github/tools.go:18
- [nitpick] Consider renaming
DefaultToolsetGrouptoNewDefaultToolsetGrouporInitDefaultToolsetGroupto follow Go constructor naming conventions and clarify intent.
func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetGQLClientFn, t translations.TranslationHelperFunc) *toolsets.ToolsetGroup {
pkg/toolsets/toolsets.go:15
- The code calls
fmt.Sprintfbutfmtis not imported; add"fmt"to the import block to avoid a compilation error.
return fmt.Sprintf("toolset %s does not exist", e.Name)
LuluBeatson
approved these changes
Jun 6, 2025
nickytonline
pushed a commit
to nickytonline/github-mcp-http
that referenced
this pull request
Oct 4, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR makes it easier to identify the error when a toolset does not exist, and also separates toolset creation from initialization, so it's possible to compose toolsets in more ways.