Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
omgitsads merged 5 commits intoomgitsads/go-sdkfromcopilot/migrate-dynamic-toolset
Nov 20, 2025

Conversation

Copy link
Contributor

CopilotAI commentedNov 20, 2025
edited
Loading

Migrates the dynamic toolset (enable_toolset,list_available_toolsets,get_toolset_tools) frommark3labs/mcp-go tomodelcontextprotocol/go-sdk. Part of#1428.

Changes

Schema Migration

  • Converted DSL-based tool definitions tojsonschema.Schema structures
  • ChangedToolsetEnum() from returningmcp.PropertyOption to[]any for enum values

Handler Updates

  • Return type:(tool, handler server.ToolHandlerFunc)(mcp.Tool, mcp.ToolHandlerFor[map[string]any, any])
  • Handler signature:func(ctx, request) (*mcp.CallToolResult, error)func(ctx, *request, args map[string]any) (*mcp.CallToolResult, any, error)
  • Parameter extraction now usesRequiredParam[T](args, key) instead ofRequiredParam[T](request, key)

Tool Registration

FixedEnableToolset to callRegisterFunc(s) on eachServerTool instead of non-existents.AddTools():

// Old approachs.AddTools(toolset.GetActiveTools()...)// New approachfor_,serverTool:=rangetoolset.GetActiveTools() {serverTool.RegisterFunc(s)}

Testing

  • Addeddynamic_tools_test.go with comprehensive test coverage
  • Generated toolsnaps for schema validation
  • Removed//go:build ignore tag - tools now included in build
Original prompt

Migrate thedynamic toolset to modelcontextprotocol/go-sdk.

This will be merged into the parent PR#1428, so reference that PR in the description to track the migration

Custom agent used: go-sdk-tool-migrator
Agent specializing in migrating MCP tools from mark3labs/mcp-go to modelcontextprotocol/go-sdk


✨ Let Copilot coding agentset things up for you — coding agent works faster and does higher quality work when set up for your repo.

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 toolsRelated to#1428Co-authored-by: omgitsads <4619+omgitsads@users.noreply.github.com>
CopilotAI changed the title[WIP] Migrate dynamic toolset to modelcontextprotocol/go-sdkMigrate dynamic toolset to modelcontextprotocol/go-sdkNov 20, 2025
CopilotAI requested a review fromomgitsadsNovember 20, 2025 10:32
Copilot finished work on behalf ofomgitsadsNovember 20, 2025 10:32
@omgitsadsomgitsads marked this pull request as ready for reviewNovember 20, 2025 15:30
@omgitsadsomgitsads requested a review froma team as acode ownerNovember 20, 2025 15:30
CopilotAI review requested due to automatic review settingsNovember 20, 2025 15:30
@omgitsads
Copy link
Member

🚀

Screenshot 2025-11-20 at 16 30 19

Copy link
Contributor

CopilotAI left a 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 themark3labs/mcp-go SDK to themodelcontextprotocol/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-basedmcp.NewTool() calls to explicitjsonschema.Schema structures
  • Handler signatures updated to use new SDK'sToolHandlerFor[map[string]any, any] pattern
  • Tool registration fixed to useRegisterFunc() 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
FileDescription
pkg/github/dynamic_tools.goMigrated three tools to new SDK with updated schemas, handlers, and tool registration logic
pkg/github/dynamic_tools_test.goAdded comprehensive test coverage for all three dynamic tools with schema validation
pkg/github/__toolsnaps__/enable_toolset.snapAdded schema snapshot forenable_toolset tool
pkg/github/__toolsnaps__/get_toolset_tools.snapAdded schema snapshot forget_toolset_tools tool
pkg/github/__toolsnaps__/list_available_toolsets.snapAdded schema snapshot forlist_available_toolsets tool

@omgitsadsomgitsads merged commit42b5533 intoomgitsads/go-sdkNov 20, 2025
13 of 14 checks passed
@omgitsadsomgitsads deleted the copilot/migrate-dynamic-toolset branchNovember 20, 2025 16:47
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

Copilot code reviewCopilotCopilot left review comments

@SamMorrowDrumsSamMorrowDrumsSamMorrowDrums approved these changes

@omgitsadsomgitsadsAwaiting requested review from omgitsads

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@omgitsads@SamMorrowDrums

[8]ページ先頭

©2009-2025 Movatter.jp