-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Migrate gists toolset to modelcontextprotocol/go-sdk #1431
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
- Remove //go:build ignore tags from gists.go and gists_test.go - Update imports to use modelcontextprotocol/go-sdk instead of mark3labs/mcp-go - Migrate all 4 tools (ListGists, GetGist, CreateGist, UpdateGist): - Updated tool definitions to use jsonschema.Schema for InputSchema - Changed handler signatures to new SDK format with generics - Updated parameter extraction to use args map instead of request object - Replaced result helpers with utils package equivalents - Updated all tests to match new handler signatures - Added toolsnap tests for all 4 tools - Added parseISOTimestamp utility function to minimal_types.go - Created toolsnaps for all 4 tools Related to #1428 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 gists toolset from mark3labs/mcp-go to modelcontextprotocol/go-sdk as part of the broader SDK migration effort (#1428). The migration updates tool definitions, handler signatures, and test infrastructure while maintaining backward compatibility.
Key Changes
- Tool definitions converted from DSL-style builders to explicit
jsonschema.Schemastructures - Handler signatures updated to use generics (
mcp.ToolHandlerFor[map[string]any, any]) with 3-value returns - Parameter extraction migrated from request-based to args-based helper functions
- Result helpers replaced with utils package equivalents
- Added shared
parseISOTimestamputility function tominimal_types.go - Fixed JSON Schema type casing in pagination helpers (Number→number, String→string)
- Toolset registration for gists uncommented in
tools.go
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/github/gists.go | Migrated all 4 gist tools (list, get, create, update) to new SDK with proper schema definitions and handler signatures |
| pkg/github/gists_test.go | Updated tests to use new handler signature (3-value returns) and added toolsnap validation for each tool |
| pkg/github/minimal_types.go | Added shared parseISOTimestamp utility function for ISO 8601 timestamp parsing |
| pkg/github/server.go | Fixed JSON Schema type casing in pagination helper functions (lowercase 'number' and 'string') |
| pkg/github/tools.go | Uncommented gists toolset registration to enable the migrated tools |
| pkg/github/toolsnaps/*.snap | Added snapshots for all 4 gist tools to document API schema changes |
| return t, nil | ||
| } | ||
|
|
||
| return time.Time{}, fmt.Errorf("invalid timestamp format: %s", timestamp) |
Copilot
AI
Nov 18, 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.
Error message in parseISOTimestamp could be more helpful. The current error message is generic:
return time.Time{}, fmt.Errorf("invalid timestamp format: %s", timestamp)Consider using a more descriptive error message that includes the supported formats, similar to the version in issues.go (line 1623):
return time.Time{}, fmt.Errorf("invalid ISO 8601 timestamp: %s (supported formats: YYYY-MM-DDThh:mm:ssZ or YYYY-MM-DD)", timestamp)This provides better guidance to users when they provide an incorrectly formatted timestamp.
| return time.Time{}, fmt.Errorf("invalid timestamp format: %s", timestamp) | |
| return time.Time{}, fmt.Errorf("invalid ISO 8601 timestamp: %s (supported formats: YYYY-MM-DDThh:mm:ssZ or YYYY-MM-DD)", timestamp) |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>




Part of #1428 - migrates the
giststoolset frommark3labs/mcp-gotomodelcontextprotocol/go-sdk.Changes
Tool definitions: Converted from DSL to
jsonschema.SchemaformatHandler signatures: Updated to use generics
mcp.ToolHandlerFor[map[string]any, any]with 3-value returns(*mcp.CallToolResult, any, error)Parameter extraction: Migrated from
OptionalParam[T](request, "key")toOptionalParam[T](args, "key")using passed mapResult helpers: Replaced
mcp.NewToolResultText/Errorwithutils.NewToolResultText/ErrorUtilities: Added
parseISOTimestamptominimal_types.go(shared utility, extracted from pending-migrationissues.go)Tools Migrated
list_gists- List user's gists with pagination and filteringget_gist- Retrieve specific gist contentcreate_gist- Create new gistupdate_gist- Update existing gistAll tests passing, toolsnaps updated.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.