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 labels toolset to modelcontextprotocol/go-sdk#1433

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 4 commits intoomgitsads/go-sdkfromcopilot/migrate-labels-toolset
Nov 19, 2025

Conversation

Copy link
Contributor

CopilotAI commentedNov 18, 2025
edited
Loading

Closes: Part of#1428

MigratesGetLabel,ListLabels, andLabelWrite tools frommark3labs/mcp-go tomodelcontextprotocol/go-sdk.

Changes

  • Tool definitions: Converted from DSL-basedmcp.NewTool() to struct-basedmcp.Tool{} with explicitjsonschema.Schema definitions
  • Handler signatures: Updated fromfunc(context.Context, mcp.CallToolRequest) (*mcp.CallToolResult, error) to generic handlersfunc(context.Context, *mcp.CallToolRequest, map[string]any) (*mcp.CallToolResult, any, error)
  • Parameter extraction: Changed fromRequiredParam[T](request, "param") toRequiredParam[T](args, "param") using passed args map
  • Result constructors: Replacedmcp.NewToolResult* withutils.NewToolResult* helpers
  • Toolsnaps: Updated to reflect property ordering changes (semantics unchanged)

Example

Before:

funcGetLabel(...) (mcp.Tool, server.ToolHandlerFunc) {returnmcp.NewTool("get_label",mcp.WithString("owner",mcp.Required(),...),...    ),func(ctx context.Context,request mcp.CallToolRequest) (*mcp.CallToolResult,error) {owner,err:=RequiredParam[string](request,"owner")...returnmcp.NewToolResultText(string(out)),nil    }}

After:

funcGetLabel(...) (mcp.Tool, mcp.ToolHandlerFor[map[string]any,any]) {tool:= mcp.Tool{Name:"get_label",InputSchema:&jsonschema.Schema{Properties:map[string]*jsonschema.Schema{"owner": {Type:"string",Description:"..."},...            },Required: []string{"owner","repo","name"},        },    }handler:= mcp.ToolHandlerFor[map[string]any,any](func(ctx context.Context,_*mcp.CallToolRequest,argsmap[string]any) (*mcp.CallToolResult,any,error) {owner,err:=RequiredParam[string](args,"owner")...returnutils.NewToolResultText(string(out)),nil,nil        })returntool,handler}
Original prompt

Migrate thelabels 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


✨ Let Copilot coding agentset things up for you — coding agent works faster and does higher quality work when set up for your repo.

…go-sdkCo-authored-by: omgitsads <4619+omgitsads@users.noreply.github.com>
CopilotAI changed the title[WIP] Migrate labels toolset to modelcontextprotocol/go-sdkMigrate labels toolset to modelcontextprotocol/go-sdkNov 18, 2025
Copilot finished work on behalf ofomgitsadsNovember 18, 2025 11:32
CopilotAI requested a review fromomgitsadsNovember 18, 2025 11:32
@LuluBeatsonLuluBeatson self-requested a reviewNovember 19, 2025 11:57
@LuluBeatson
Copy link
Contributor

imageimageimage

@LuluBeatsonLuluBeatson marked this pull request as ready for reviewNovember 19, 2025 13:06
@LuluBeatsonLuluBeatson requested a review froma team as acode ownerNovember 19, 2025 13:06
CopilotAI review requested due to automatic review settingsNovember 19, 2025 13:06
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 the labels toolset (GetLabel,ListLabels,LabelWrite) from the legacymark3labs/mcp-go SDK to the newmodelcontextprotocol/go-sdk, continuing the migration effort tracked in#1428.

Key changes:

  • Converted tool definitions from DSL-based to struct-based with explicit JSON schemas
  • Updated handler signatures to use genericmcp.ToolHandlerFor[map[string]any, any] type
  • Modified parameter extraction to use passed args map instead of request object
  • Updated result constructors to useutils.NewToolResult* helpers

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
FileDescription
pkg/github/labels.goMigratedGetLabel,ListLabels, andLabelWrite tool definitions and handlers to new SDK patterns with struct-based schemas and generic handler types
pkg/github/labels_test.goRemoved//go:build ignore directive, updated test assertions to checkReadOnlyHint annotations directly, and adapted handler invocations to new 3-return signature
pkg/github/tools.goUncommented and re-enabled labels toolset registration in the default toolset group
pkg/github/toolsnaps/get_label.snapReordered JSON properties and movedtype beforerequired in schema (no semantic changes)
pkg/github/toolsnaps/list_label.snapReordered JSON properties and movedtype beforerequired in schema (no semantic changes)
pkg/github/toolsnaps/label_write.snapReordered JSON properties, movedtype beforerequired, and removed explicitreadOnlyHint: false (omitted false values per new SDK conventions)

@omgitsadsomgitsads merged commit9bf905b intoomgitsads/go-sdkNov 19, 2025
19 of 20 checks passed
@omgitsadsomgitsads deleted the copilot/migrate-labels-toolset branchNovember 19, 2025 16:33
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