Migrate actions toolset to modelcontextprotocol/go-sdk#1446
Migrate actions toolset to modelcontextprotocol/go-sdk#1446omgitsads merged 6 commits intoomgitsads/go-sdkfrom
Conversation
- Removed //go:build ignore tags from actions.go and actions_test.go - Updated imports to use modelcontextprotocol/go-sdk instead of mark3labs/mcp-go - Updated all tool constructor signatures to return new types - Converted all tool definitions from DSL format to jsonschema.Schema format - Updated tool handler signatures to use generics - Updated parameter extraction to use args map instead of request - Replaced mcp.NewToolResultText/Error with utils package functions - Updated all tests to work with new handler signature - Updated toolsnaps for all actions tools Co-authored-by: omgitsads <4619+omgitsads@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
This PR migrates the actions toolset (17 tools) from mark3labs/mcp-go to modelcontextprotocol/go-sdk, updating tool signatures, schema definitions, parameter extraction, and result helpers to match the new SDK patterns.
Key Changes:
- Updated all 17 action tools to use new SDK signatures:
(mcp.Tool, mcp.ToolHandlerFor[map[string]any, any]) - Converted DSL-based schemas to
jsonschema.Schemastructures with explicit type definitions - Migrated from
request.GetArguments()to directargs map[string]anyparameter extraction
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pkg/github/actions.go | Migrated all 17 action tools to new SDK with updated signatures, jsonschema definitions, and utils result helpers |
| pkg/github/actions_test.go | Removed build ignore tag, updated all test invocations to 3-arg/3-return pattern, added toolsnap validation, and updated schema type assertions |
| pkg/github/tools.go | Uncommented and registered the actions toolset in the default toolset group |
| pkg/github/toolsnaps/*.snap | Added 14 new snapshot files documenting the JSON schema for each action tool |
|
There were no existing toolsnaps for actions tools before this migration. I've updated To ensure that tool schemas were not changed by the migration, I connected to the local (dev) server and remote servers and saved their tools/list responses in JSON files. I then compared the two files using a (copilot written) python script. The script checked for equivalence ignoring order of fields and ignoring omission of defaults (e.g. To ensure the tools still worked, I reviewed the PR diffs, ran tests. I also asked copilot to test all 14 tools: |




Closes: https://github.com/github/copilot-agent-services/issues/906
Related to #1428
Migrates the
actionstoolset (17 tools) frommark3labs/mcp-gotomodelcontextprotocol/go-sdk.Changes
Tool signatures
(mcp.Tool, server.ToolHandlerFunc)→(mcp.Tool, mcp.ToolHandlerFor[map[string]any, any])func(ctx, request) (*Result, error)→func(ctx, *request, args) (*Result, any, error)Schema definitions
jsonschema.Schemastructuresmcp.WithString("owner", mcp.Required())→Properties: map[string]*jsonschema.Schema{"owner": {Type: "string"}}, Required: []string{"owner"}Parameter extraction
args map[string]anyinstead ofrequest.GetArguments()RequiredParam[T](request, "key")→RequiredParam[T](args, "key")Result helpers
mcp.NewToolResultText/Errorwithutils.NewToolResultText/ErrorTests
jsonschemaimport and type assertions for schema validationAll 17 tools migrated: ListWorkflows, ListWorkflowRuns, RunWorkflow, GetWorkflowRun, GetWorkflowRunLogs, ListWorkflowJobs, GetJobLogs, RerunWorkflowRun, RerunFailedJobs, CancelWorkflowRun, ListWorkflowRunArtifacts, DownloadWorkflowRunArtifact, DeleteWorkflowRunLogs, GetWorkflowRunUsage, plus 3 helper functions.
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.