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

chore: export issues funcs#163

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
SamMorrowDrums merged 3 commits intomainfromexport-issues
Apr 8, 2025
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletionspkg/github/issues.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -14,8 +14,8 @@ import (
"github.com/mark3labs/mcp-go/server"
)

//getIssue creates a tool to get details of a specific issue in a GitHub repository.
funcgetIssue(client *github.Client, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc) {
//GetIssue creates a tool to get details of a specific issue in a GitHub repository.
funcGetIssue(client *github.Client, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc) {
return mcp.NewTool("get_issue",
mcp.WithDescription(t("TOOL_GET_ISSUE_DESCRIPTION", "Get details of a specific issue in a GitHub repository")),
mcp.WithString("owner",
Expand DownExpand Up@@ -68,8 +68,8 @@ func getIssue(client *github.Client, t translations.TranslationHelperFunc) (tool
}
}

//addIssueComment creates a tool to add a comment to an issue.
funcaddIssueComment(client *github.Client, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc) {
//AddIssueComment creates a tool to add a comment to an issue.
funcAddIssueComment(client *github.Client, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc) {
return mcp.NewTool("add_issue_comment",
mcp.WithDescription(t("TOOL_ADD_ISSUE_COMMENT_DESCRIPTION", "Add a comment to an existing issue")),
mcp.WithString("owner",
Expand DownExpand Up@@ -134,8 +134,8 @@ func addIssueComment(client *github.Client, t translations.TranslationHelperFunc
}
}

//searchIssues creates a tool to search for issues and pull requests.
funcsearchIssues(client *github.Client, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc) {
//SearchIssues creates a tool to search for issues and pull requests.
funcSearchIssues(client *github.Client, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc) {
return mcp.NewTool("search_issues",
mcp.WithDescription(t("TOOL_SEARCH_ISSUES_DESCRIPTION", "Search for issues and pull requests across GitHub repositories")),
mcp.WithString("q",
Expand DownExpand Up@@ -214,8 +214,8 @@ func searchIssues(client *github.Client, t translations.TranslationHelperFunc) (
}
}

//createIssue creates a tool to create a new issue in a GitHub repository.
funccreateIssue(client *github.Client, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc) {
//CreateIssue creates a tool to create a new issue in a GitHub repository.
funcCreateIssue(client *github.Client, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc) {
return mcp.NewTool("create_issue",
mcp.WithDescription(t("TOOL_CREATE_ISSUE_DESCRIPTION", "Create a new issue in a GitHub repository")),
mcp.WithString("owner",
Expand DownExpand Up@@ -328,8 +328,8 @@ func createIssue(client *github.Client, t translations.TranslationHelperFunc) (t
}
}

//listIssues creates a tool to list and filter repository issues
funclistIssues(client *github.Client, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc) {
//ListIssues creates a tool to list and filter repository issues
funcListIssues(client *github.Client, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc) {
return mcp.NewTool("list_issues",
mcp.WithDescription(t("TOOL_LIST_ISSUES_DESCRIPTION", "List issues in a GitHub repository with filtering options")),
mcp.WithString("owner",
Expand DownExpand Up@@ -442,8 +442,8 @@ func listIssues(client *github.Client, t translations.TranslationHelperFunc) (to
}
}

//updateIssue creates a tool to update an existing issue in a GitHub repository.
funcupdateIssue(client *github.Client, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc) {
//UpdateIssue creates a tool to update an existing issue in a GitHub repository.
funcUpdateIssue(client *github.Client, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc) {
return mcp.NewTool("update_issue",
mcp.WithDescription(t("TOOL_UPDATE_ISSUE_DESCRIPTION", "Update an existing issue in a GitHub repository")),
mcp.WithString("owner",
Expand DownExpand Up@@ -580,8 +580,8 @@ func updateIssue(client *github.Client, t translations.TranslationHelperFunc) (t
}
}

//getIssueComments creates a tool to get comments for a GitHub issue.
funcgetIssueComments(client *github.Client, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc) {
//GetIssueComments creates a tool to get comments for a GitHub issue.
funcGetIssueComments(client *github.Client, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc) {
return mcp.NewTool("get_issue_comments",
mcp.WithDescription(t("TOOL_GET_ISSUE_COMMENTS_DESCRIPTION", "Get comments for a GitHub issue")),
mcp.WithString("owner",
Expand Down
28 changes: 14 additions & 14 deletionspkg/github/issues_test.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,7 +18,7 @@ import (
func Test_GetIssue(t *testing.T) {
// Verify tool definition once
mockClient := github.NewClient(nil)
tool, _ :=getIssue(mockClient, translations.NullTranslationHelper)
tool, _ :=GetIssue(mockClient, translations.NullTranslationHelper)

assert.Equal(t, "get_issue", tool.Name)
assert.NotEmpty(t, tool.Description)
Expand DownExpand Up@@ -82,7 +82,7 @@ func Test_GetIssue(t *testing.T) {
t.Run(tc.name, func(t *testing.T) {
// Setup client with mock
client := github.NewClient(tc.mockedClient)
_, handler :=getIssue(client, translations.NullTranslationHelper)
_, handler :=GetIssue(client, translations.NullTranslationHelper)

// Create call request
request := createMCPRequest(tc.requestArgs)
Expand DownExpand Up@@ -114,7 +114,7 @@ func Test_GetIssue(t *testing.T) {
func Test_AddIssueComment(t *testing.T) {
// Verify tool definition once
mockClient := github.NewClient(nil)
tool, _ :=addIssueComment(mockClient, translations.NullTranslationHelper)
tool, _ :=AddIssueComment(mockClient, translations.NullTranslationHelper)

assert.Equal(t, "add_issue_comment", tool.Name)
assert.NotEmpty(t, tool.Description)
Expand DownExpand Up@@ -185,7 +185,7 @@ func Test_AddIssueComment(t *testing.T) {
t.Run(tc.name, func(t *testing.T) {
// Setup client with mock
client := github.NewClient(tc.mockedClient)
_, handler :=addIssueComment(client, translations.NullTranslationHelper)
_, handler :=AddIssueComment(client, translations.NullTranslationHelper)

// Create call request
request := mcp.CallToolRequest{
Expand DownExpand Up@@ -237,7 +237,7 @@ func Test_AddIssueComment(t *testing.T) {
func Test_SearchIssues(t *testing.T) {
// Verify tool definition once
mockClient := github.NewClient(nil)
tool, _ :=searchIssues(mockClient, translations.NullTranslationHelper)
tool, _ :=SearchIssues(mockClient, translations.NullTranslationHelper)

assert.Equal(t, "search_issues", tool.Name)
assert.NotEmpty(t, tool.Description)
Expand DownExpand Up@@ -352,7 +352,7 @@ func Test_SearchIssues(t *testing.T) {
t.Run(tc.name, func(t *testing.T) {
// Setup client with mock
client := github.NewClient(tc.mockedClient)
_, handler :=searchIssues(client, translations.NullTranslationHelper)
_, handler :=SearchIssues(client, translations.NullTranslationHelper)

// Create call request
request := createMCPRequest(tc.requestArgs)
Expand DownExpand Up@@ -393,7 +393,7 @@ func Test_SearchIssues(t *testing.T) {
func Test_CreateIssue(t *testing.T) {
// Verify tool definition once
mockClient := github.NewClient(nil)
tool, _ :=createIssue(mockClient, translations.NullTranslationHelper)
tool, _ :=CreateIssue(mockClient, translations.NullTranslationHelper)

assert.Equal(t, "create_issue", tool.Name)
assert.NotEmpty(t, tool.Description)
Expand DownExpand Up@@ -505,7 +505,7 @@ func Test_CreateIssue(t *testing.T) {
t.Run(tc.name, func(t *testing.T) {
// Setup client with mock
client := github.NewClient(tc.mockedClient)
_, handler :=createIssue(client, translations.NullTranslationHelper)
_, handler :=CreateIssue(client, translations.NullTranslationHelper)

// Create call request
request := createMCPRequest(tc.requestArgs)
Expand DownExpand Up@@ -566,7 +566,7 @@ func Test_CreateIssue(t *testing.T) {
func Test_ListIssues(t *testing.T) {
// Verify tool definition
mockClient := github.NewClient(nil)
tool, _ :=listIssues(mockClient, translations.NullTranslationHelper)
tool, _ :=ListIssues(mockClient, translations.NullTranslationHelper)

assert.Equal(t, "list_issues", tool.Name)
assert.NotEmpty(t, tool.Description)
Expand DownExpand Up@@ -697,7 +697,7 @@ func Test_ListIssues(t *testing.T) {
t.Run(tc.name, func(t *testing.T) {
// Setup client with mock
client := github.NewClient(tc.mockedClient)
_, handler :=listIssues(client, translations.NullTranslationHelper)
_, handler :=ListIssues(client, translations.NullTranslationHelper)

// Create call request
request := createMCPRequest(tc.requestArgs)
Expand DownExpand Up@@ -742,7 +742,7 @@ func Test_ListIssues(t *testing.T) {
func Test_UpdateIssue(t *testing.T) {
// Verify tool definition
mockClient := github.NewClient(nil)
tool, _ :=updateIssue(mockClient, translations.NullTranslationHelper)
tool, _ :=UpdateIssue(mockClient, translations.NullTranslationHelper)

assert.Equal(t, "update_issue", tool.Name)
assert.NotEmpty(t, tool.Description)
Expand DownExpand Up@@ -881,7 +881,7 @@ func Test_UpdateIssue(t *testing.T) {
t.Run(tc.name, func(t *testing.T) {
// Setup client with mock
client := github.NewClient(tc.mockedClient)
_, handler :=updateIssue(client, translations.NullTranslationHelper)
_, handler :=UpdateIssue(client, translations.NullTranslationHelper)

// Create call request
request := createMCPRequest(tc.requestArgs)
Expand DownExpand Up@@ -999,7 +999,7 @@ func Test_ParseISOTimestamp(t *testing.T) {
func Test_GetIssueComments(t *testing.T) {
// Verify tool definition once
mockClient := github.NewClient(nil)
tool, _ :=getIssueComments(mockClient, translations.NullTranslationHelper)
tool, _ :=GetIssueComments(mockClient, translations.NullTranslationHelper)

assert.Equal(t, "get_issue_comments", tool.Name)
assert.NotEmpty(t, tool.Description)
Expand DownExpand Up@@ -1099,7 +1099,7 @@ func Test_GetIssueComments(t *testing.T) {
t.Run(tc.name, func(t *testing.T) {
// Setup client with mock
client := github.NewClient(tc.mockedClient)
_, handler :=getIssueComments(client, translations.NullTranslationHelper)
_, handler :=GetIssueComments(client, translations.NullTranslationHelper)

// Create call request
request := createMCPRequest(tc.requestArgs)
Expand Down
14 changes: 7 additions & 7 deletionspkg/github/server.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -31,14 +31,14 @@ func NewServer(client *github.Client, version string, readOnly bool, t translati
s.AddResourceTemplate(getRepositoryResourcePrContent(client, t))

// Add GitHub tools - Issues
s.AddTool(getIssue(client, t))
s.AddTool(searchIssues(client, t))
s.AddTool(listIssues(client, t))
s.AddTool(getIssueComments(client, t))
s.AddTool(GetIssue(client, t))
s.AddTool(SearchIssues(client, t))
s.AddTool(ListIssues(client, t))
s.AddTool(GetIssueComments(client, t))
if !readOnly {
s.AddTool(createIssue(client, t))
s.AddTool(addIssueComment(client, t))
s.AddTool(updateIssue(client, t))
s.AddTool(CreateIssue(client, t))
s.AddTool(AddIssueComment(client, t))
s.AddTool(UpdateIssue(client, t))
}

// Add GitHub tools - Pull Requests
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp