Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 20, 2025

Migrates the pullrequests toolset from mark3labs/mcp-go to modelcontextprotocol/go-sdk. This is part of the broader SDK migration tracked in #1428.

Status

Migrated (2/10 tools):

  • PullRequestRead - 6 methods (get, get_diff, get_status, get_files, get_review_comments, get_reviews)
  • CreatePullRequest

Pending (8/10 tools): Commented out with TODO: MIGRATE THIS TOOL

  • UpdatePullRequest, ListPullRequests, MergePullRequest, SearchPullRequests, UpdatePullRequestBranch, PullRequestReviewWrite, AddCommentToPendingReview, RequestCopilotReview

Changes

Tool definition pattern:

// Old DSL-based func Foo(...) (mcp.Tool, server.ToolHandlerFunc) { return mcp.NewTool("name", mcp.WithString("param", mcp.Required(), ...), ... ), handler } // New JSON Schema-based func Foo(...) (mcp.Tool, mcp.ToolHandlerFor[map[string]any, any]) { tool := mcp.Tool{ Name: "name", InputSchema: &jsonschema.Schema{ Type: "object", Properties: map[string]*jsonschema.Schema{ "param": {Type: "string", ...}, }, Required: []string{"param"}, }, } handler := mcp.ToolHandlerFor[map[string]any, any]( func(ctx context.Context, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) { // params extracted from args map }, ) return tool, handler }

Key signature changes:

  • Handler: (ctx, request) (*Result, error)(ctx, _, args map[string]any) (*Result, any, error)
  • Parameter extraction: RequiredParam[T](request, "key")RequiredParam[T](args, "key")
  • Result construction: mcp.NewToolResultText()utils.NewToolResultText()

Notes:

  • get_comments method temporarily disabled (depends on unmigrated issues.go)
  • Helper functions return (*Result, error), handlers return (*Result, any, error)
  • search_utils.go updated to accept args map[string]any
Original prompt

Migrate the pullrequests 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 agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits November 20, 2025 10:19
…tools complete Co-authored-by: omgitsads <4619+omgitsads@users.noreply.github.com>
…st) and fixed helper functions Co-authored-by: omgitsads <4619+omgitsads@users.noreply.github.com>
Copilot AI changed the title [WIP] Migrate pullrequests toolset to modelcontextprotocol/go-sdk [WIP] Partial migration of pullrequests toolset to modelcontextprotocol/go-sdk Nov 20, 2025
Copilot AI requested a review from omgitsads November 20, 2025 10:29
Copilot finished work on behalf of omgitsads November 20, 2025 10:29
@LuluBeatson
Copy link
Contributor

Replaced by #1466

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants