-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Migrate labels toolset to modelcontextprotocol/go-sdk #1433
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
…go-sdk 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 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) |



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.