- Notifications
You must be signed in to change notification settings - Fork3.1k
Migrate dependabot toolset to modelcontextprotocol/go-sdk#1429
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Co-authored-by: omgitsads <4619+omgitsads@users.noreply.github.com>
LuluBeatson commentedNov 19, 2025
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 thedependabot toolset frommark3labs/mcp-go tomodelcontextprotocol/go-sdk, completing the migration of another toolset to the new SDK. The migration updates function signatures, schema definitions, and error handling patterns to align with the new SDK's API.
- Migrated two dependabot tools (
get_dependabot_alertandlist_dependabot_alerts) to use the new SDK - Updated schema definitions from DSL-based to struct-based initialization with
jsonschema.Schema - Modified handler signatures to return three values
(*mcp.CallToolResult, any, error)instead of two - Re-enabled the dependabot toolset in the default toolset group
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/github/dependabot.go | Migrated tool implementations to new SDK with updated function signatures, schema definitions, and result helpers |
| pkg/github/dependabot_test.go | Updated tests to match new handler signatures and removed direct schema assertions in favor of toolsnap validation |
| pkg/github/tools.go | Uncommented dependabot toolset registration to re-enable it in the default toolset group |
| pkg/github/toolsnaps/get_dependabot_alert.snap | Cosmetic reordering of JSON fields (no functional changes) |
| pkg/github/toolsnaps/list_dependabot_alerts.snap | Cosmetic reordering of JSON fields (no functional changes) |
| body,err:=io.ReadAll(resp.Body) | ||
| iferr!=nil { | ||
| returnnil,fmt.Errorf("failed tomarshal alert: %w",err) | ||
| returnutils.NewToolResultErrorFromErr("failed toread response body",err),nil,err |
CopilotAINov 19, 2025
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.
Inconsistent error handling pattern. When returning an error result usingutils.NewToolResultErrorFromErr, the third return value should benil, noterr. The error is already embedded in the result.
The correct pattern (consistent withcode_scanning.go line 77) is:
returnutils.NewToolResultErrorFromErr("failed to read response body",err),nil,nil
| returnutils.NewToolResultErrorFromErr("failed to read response body",err),nil,err | |
| returnutils.NewToolResultErrorFromErr("failed to read response body",err),nil,nil |
| returnmcp.NewToolResultText(string(r)),nil | ||
| r,err:=json.Marshal(alert) | ||
| iferr!=nil { | ||
| returnutils.NewToolResultErrorFromErr("failed to marshal alert",err),nil,err |
CopilotAINov 19, 2025
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.
Inconsistent error handling pattern. When returning an error result usingutils.NewToolResultErrorFromErr, the third return value should benil, noterr. The error is already embedded in the result.
The correct pattern (consistent withcode_scanning.go line 84) is:
returnutils.NewToolResultErrorFromErr("failed to marshal alert",err),nil,nil
| returnutils.NewToolResultErrorFromErr("failed to marshal alert",err),nil,err | |
| returnutils.NewToolResultErrorFromErr("failed to marshal alert",err),nil,nil |
| } | ||
| client,err:=getClient(ctx) | ||
| iferr!=nil { | ||
| returnutils.NewToolResultErrorFromErr("failed to get GitHub client",err),nil,err |
CopilotAINov 19, 2025
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.
Inconsistent error handling pattern. When returning an error result usingutils.NewToolResultErrorFromErr, the third return value should benil, noterr. The error is already embedded in the result.
The correct pattern (consistent withcode_scanning.go line 161) is:
returnutils.NewToolResultErrorFromErr("failed to get GitHub client",err),nil,nil
| returnutils.NewToolResultErrorFromErr("failed to get GitHub client",err),nil,err | |
| returnutils.NewToolResultErrorFromErr("failed to get GitHub client",err),nil,nil |
| body,err:=io.ReadAll(resp.Body) | ||
| iferr!=nil { | ||
| returnnil,fmt.Errorf("failed tomarshal alerts: %w",err) | ||
| returnutils.NewToolResultErrorFromErr("failed toread response body",err),nil,err |
CopilotAINov 19, 2025
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.
Inconsistent error handling pattern. When returning an error result usingutils.NewToolResultErrorFromErr, the third return value should benil, noterr. The error is already embedded in the result.
The correct pattern (consistent withcode_scanning.go line 176) is:
returnutils.NewToolResultErrorFromErr("failed to read response body",err),nil,nil
| returnutils.NewToolResultErrorFromErr("failed to read response body",err),nil,err | |
| returnutils.NewToolResultErrorFromErr("failed to read response body",err),nil,nil |
| returnmcp.NewToolResultText(string(r)),nil | ||
| r,err:=json.Marshal(alerts) | ||
| iferr!=nil { | ||
| returnutils.NewToolResultErrorFromErr("failed to marshal alerts",err),nil,err |
CopilotAINov 19, 2025
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.
Inconsistent error handling pattern. When returning an error result usingutils.NewToolResultErrorFromErr, the third return value should benil, noterr. The error is already embedded in the result.
The correct pattern (consistent withcode_scanning.go line 183) is:
returnutils.NewToolResultErrorFromErr("failed to marshal alerts",err),nil,nil
| returnutils.NewToolResultErrorFromErr("failed to marshal alerts",err),nil,err | |
| returnutils.NewToolResultErrorFromErr("failed to marshal alerts",err),nil,nil |
| } | ||
| client,err:=getClient(ctx) | ||
| iferr!=nil { | ||
| returnutils.NewToolResultErrorFromErr("failed to get GitHub client",err),nil,err |
CopilotAINov 19, 2025
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.
Inconsistent error handling pattern. When returning an error result usingutils.NewToolResultErrorFromErr, the third return value should benil, noterr. The error is already embedded in the result.
The correct pattern (consistent withcode_scanning.go line 61, 77, 84) is:
returnutils.NewToolResultErrorFromErr("failed to get GitHub client",err),nil,nil
Not:
returnutils.NewToolResultErrorFromErr("failed to get GitHub client",err),nil,err
| returnutils.NewToolResultErrorFromErr("failed to get GitHub client",err),nil,err | |
| returnutils.NewToolResultErrorFromErr("failed to get GitHub client",err),nil,nil |
4c3d834 to183d17aCompare1b769a5 intoomgitsads/go-sdkUh oh!
There was an error while loading.Please reload this page.

Uh oh!
There was an error while loading.Please reload this page.
Closes:
Migrates the
dependabottoolset frommark3labs/mcp-gotomodelcontextprotocol/go-sdk.Changes
Function signatures
(mcp.Tool, server.ToolHandlerFunc)→(mcp.Tool, mcp.ToolHandlerFor[map[string]any, any])func(ctx, request)→func(ctx, *request, args map[string]any)with 3 return valuesSchema definitions
mcp.NewTool()) to struct initialization (mcp.Tool{})InputSchemausingjsonschema.Schemawith explicit propertiesjson.RawMessage(e.g.,Default: json.RawMessage(\"open"`)`)Result helpers
mcp.NewToolResult*()→utils.NewToolResult*()Tests
args map[string]anyBefore/After
Before (mark3labs/mcp-go):
After (modelcontextprotocol/go-sdk):
Toolsnaps updated with cosmetic field reordering only—schemas remain functionally identical.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn moreCopilot coding agent tips in the docs.