Migrate labels toolset to modelcontextprotocol/go-sdk#1433
Merged
omgitsads merged 4 commits intoomgitsads/go-sdkfrom Nov 19, 2025
Merged
Migrate labels toolset to modelcontextprotocol/go-sdk#1433omgitsads merged 4 commits intoomgitsads/go-sdkfrom
omgitsads merged 4 commits intoomgitsads/go-sdkfrom
Conversation
…go-sdk Co-authored-by: omgitsads <4619+omgitsads@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Migrate labels toolset to modelcontextprotocol/go-sdk
Migrate labels toolset to modelcontextprotocol/go-sdk
Nov 18, 2025
Contributor
LuluBeatson
approved these changes
Nov 19, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR migrates the labels toolset (GetLabel, ListLabels, LabelWrite) from the legacy mark3labs/mcp-go SDK to the new modelcontextprotocol/go-sdk, continuing the migration effort tracked in #1428.
Key changes:
- Converted tool definitions from DSL-based to struct-based with explicit JSON schemas
- Updated handler signatures to use generic
mcp.ToolHandlerFor[map[string]any, any]type - Modified parameter extraction to use passed args map instead of request object
- Updated result constructors to use
utils.NewToolResult*helpers
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/github/labels.go | Migrated GetLabel, ListLabels, and LabelWrite tool definitions and handlers to new SDK patterns with struct-based schemas and generic handler types |
| pkg/github/labels_test.go | Removed //go:build ignore directive, updated test assertions to check ReadOnlyHint annotations directly, and adapted handler invocations to new 3-return signature |
| pkg/github/tools.go | Uncommented and re-enabled labels toolset registration in the default toolset group |
| pkg/github/toolsnaps/get_label.snap | Reordered JSON properties and moved type before required in schema (no semantic changes) |
| pkg/github/toolsnaps/list_label.snap | Reordered JSON properties and moved type before required in schema (no semantic changes) |
| pkg/github/toolsnaps/label_write.snap | Reordered JSON properties, moved type before required, and removed explicit readOnlyHint: false (omitted false values per new SDK conventions) |
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.



Closes: Part of #1428
Migrates
GetLabel,ListLabels, andLabelWritetools frommark3labs/mcp-gotomodelcontextprotocol/go-sdk.Changes
mcp.NewTool()to struct-basedmcp.Tool{}with explicitjsonschema.Schemadefinitionsfunc(context.Context, mcp.CallToolRequest) (*mcp.CallToolResult, error)to generic handlersfunc(context.Context, *mcp.CallToolRequest, map[string]any) (*mcp.CallToolResult, any, error)RequiredParam[T](request, "param")toRequiredParam[T](args, "param")using passed args mapmcp.NewToolResult*withutils.NewToolResult*helpersExample
Before:
After:
Original 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.