Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
omgitsads merged 9 commits intoomgitsads/go-sdkfromcopilot/migrate-gists-toolset
Nov 19, 2025

Conversation

Copy link
Contributor

CopilotAI commentedNov 18, 2025
edited
Loading

Part of#1428 - migrates thegists toolset frommark3labs/mcp-go tomodelcontextprotocol/go-sdk.

Changes

  • Tool definitions: Converted from DSL tojsonschema.Schema format

    // Beforemcp.NewTool("list_gists",mcp.WithString("username",mcp.Description("...")),mcp.WithString("since",mcp.Description("...")),WithPagination(),)// Aftertool:= mcp.Tool{Name:"list_gists",InputSchema:WithPagination(&jsonschema.Schema{Type:"object",Properties:map[string]*jsonschema.Schema{"username": {Type:"string",Description:"..."},"since": {Type:"string",Description:"..."},        },    }),}
  • Handler signatures: Updated to use genericsmcp.ToolHandlerFor[map[string]any, any] with 3-value returns(*mcp.CallToolResult, any, error)

  • Parameter extraction: Migrated fromOptionalParam[T](request, "key") toOptionalParam[T](args, "key") using passed map

  • Result helpers: Replacedmcp.NewToolResultText/Error withutils.NewToolResultText/Error

  • Utilities: AddedparseISOTimestamp tominimal_types.go (shared utility, extracted from pending-migrationissues.go)

Tools Migrated

  • list_gists - List user's gists with pagination and filtering
  • get_gist - Retrieve specific gist content
  • create_gist - Create new gist
  • update_gist - Update existing gist

All tests passing, toolsnaps updated.

Original prompt

Migrate thegists toolset tomodelcontextprotocol/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


💬 We'd love your input! Share your thoughts on Copilot coding agent in our2 minute survey.

- 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 toolsRelated to#1428Co-authored-by: omgitsads <4619+omgitsads@users.noreply.github.com>
CopilotAI changed the title[WIP] Migrate gists toolset to modelcontextprotocol/go-sdkMigrate gists toolset to modelcontextprotocol/go-sdkNov 18, 2025
CopilotAI requested a review fromomgitsadsNovember 18, 2025 11:32
Copilot finished work on behalf ofomgitsadsNovember 18, 2025 11:32
@LuluBeatsonLuluBeatson self-requested a reviewNovember 18, 2025 15:50
@LuluBeatsonLuluBeatson marked this pull request as ready for reviewNovember 18, 2025 16:55
@LuluBeatsonLuluBeatson requested a review froma team as acode ownerNovember 18, 2025 16:55
CopilotAI review requested due to automatic review settingsNovember 18, 2025 16:55
@LuluBeatson
Copy link
Contributor

Copilot finished reviewing on behalf ofLuluBeatsonNovember 18, 2025 16:59
Copy link
Contributor

CopilotAI left a 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 thegists toolset frommark3labs/mcp-go tomodelcontextprotocol/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 explicitjsonschema.Schema structures
  • 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 sharedparseISOTimestamp utility function tominimal_types.go
  • Fixed JSON Schema type casing in pagination helpers (Number→number, String→string)
  • Toolset registration for gists uncommented intools.go

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 8 comments.

Show a summary per file
FileDescription
pkg/github/gists.goMigrated all 4 gist tools (list, get, create, update) to new SDK with proper schema definitions and handler signatures
pkg/github/gists_test.goUpdated tests to use new handler signature (3-value returns) and added toolsnap validation for each tool
pkg/github/minimal_types.goAdded sharedparseISOTimestamp utility function for ISO 8601 timestamp parsing
pkg/github/server.goFixed JSON Schema type casing in pagination helper functions (lowercase 'number' and 'string')
pkg/github/tools.goUncommented gists toolset registration to enable the migrated tools
pkg/github/toolsnaps/*.snapAdded snapshots for all 4 gist tools to document API schema changes

returnt,nil
}

return time.Time{},fmt.Errorf("invalid timestamp format: %s",timestamp)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Error message inparseISOTimestamp 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 inissues.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.

Suggested change
return time.Time{},fmt.Errorf("invalidtimestamp format: %s",timestamp)
return time.Time{},fmt.Errorf("invalidISO 8601 timestamp: %s (supported formats: YYYY-MM-DDThh:mm:ssZ or YYYY-MM-DD)",timestamp)

Copilot uses AI. Check for mistakes.
@omgitsadsomgitsads merged commit6c07546 intoomgitsads/go-sdkNov 19, 2025
13 of 14 checks passed
@omgitsadsomgitsads deleted the copilot/migrate-gists-toolset branchNovember 19, 2025 10:44
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

Copilot code reviewCopilotCopilot left review comments

@LuluBeatsonLuluBeatsonLuluBeatson approved these changes

@omgitsadsomgitsadsAwaiting requested review from omgitsads

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@LuluBeatson@omgitsads

[8]ページ先頭

©2009-2025 Movatter.jp