-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Migrate dynamic toolset to modelcontextprotocol/go-sdk #1450
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
Conversation
This commit migrates the dynamic toolset (enable_toolset, list_available_toolsets, get_toolset_tools) from mark3labs/mcp-go to modelcontextprotocol/go-sdk. Changes: - Removed //go:build ignore tag - Updated imports to use modelcontextprotocol/go-sdk - Migrated all tool functions to use new SDK patterns - Updated ToolsetEnum helper to return []any instead of mcp.PropertyOption - Converted DSL-based schema definitions to jsonschema.Schema structures - Updated handler signatures to use map[string]any args - Replaced old result helpers with utils package equivalents - Fixed EnableToolset to use RegisterFunc instead of AddTools - Created comprehensive test suite for all three tools - Generated toolsnaps for the new tools Related to #1428 Co-authored-by: omgitsads <4619+omgitsads@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 migrates the dynamic toolset functionality (enable_toolset, list_available_toolsets, get_toolset_tools) from the mark3labs/mcp-go SDK to the modelcontextprotocol/go-sdk. The migration includes schema conversion from DSL to JSON Schema, handler signature updates, and fixing tool registration logic.
Key changes:
- Schema definitions converted from DSL-based
mcp.NewTool()calls to explicitjsonschema.Schemastructures - Handler signatures updated to use new SDK's
ToolHandlerFor[map[string]any, any]pattern - Tool registration fixed to use
RegisterFunc()method instead of non-existentAddTools()
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
pkg/github/dynamic_tools.go |
Migrated three tools to new SDK with updated schemas, handlers, and tool registration logic |
pkg/github/dynamic_tools_test.go |
Added comprehensive test coverage for all three dynamic tools with schema validation |
pkg/github/__toolsnaps__/enable_toolset.snap |
Added schema snapshot for enable_toolset tool |
pkg/github/__toolsnaps__/get_toolset_tools.snap |
Added schema snapshot for get_toolset_tools tool |
pkg/github/__toolsnaps__/list_available_toolsets.snap |
Added schema snapshot for list_available_toolsets tool |
…iables first. This stops copilot complaining in review that the variables are unused.

Migrates the dynamic toolset (
enable_toolset,list_available_toolsets,get_toolset_tools) frommark3labs/mcp-gotomodelcontextprotocol/go-sdk. Part of #1428.Changes
Schema Migration
jsonschema.SchemastructuresToolsetEnum()from returningmcp.PropertyOptionto[]anyfor enum valuesHandler Updates
(tool, handler server.ToolHandlerFunc)→(mcp.Tool, mcp.ToolHandlerFor[map[string]any, any])func(ctx, request) (*mcp.CallToolResult, error)→func(ctx, *request, args map[string]any) (*mcp.CallToolResult, any, error)RequiredParam[T](args, key)instead ofRequiredParam[T](request, key)Tool Registration
Fixed
EnableToolsetto callRegisterFunc(s)on eachServerToolinstead of non-existents.AddTools():Testing
dynamic_tools_test.gowith comprehensive test coverage//go:build ignoretag - tools now included in buildOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.