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 search funcs#167

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 6 commits intomainfromexport-search
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
12 changes: 6 additions & 6 deletionspkg/github/search.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,8 +12,8 @@ import (
"github.com/mark3labs/mcp-go/server"
)

//searchRepositories creates a tool to search for GitHub repositories.
funcsearchRepositories(client *github.Client, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc) {
//SearchRepositories creates a tool to search for GitHub repositories.
funcSearchRepositories(client *github.Client, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc) {
return mcp.NewTool("search_repositories",
mcp.WithDescription(t("TOOL_SEARCH_REPOSITORIES_DESCRIPTION", "Search for GitHub repositories")),
mcp.WithString("query",
Expand DownExpand Up@@ -62,8 +62,8 @@ func searchRepositories(client *github.Client, t translations.TranslationHelperF
}
}

//searchCode creates a tool to search for code across GitHub repositories.
funcsearchCode(client *github.Client, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc) {
//SearchCode creates a tool to search for code across GitHub repositories.
funcSearchCode(client *github.Client, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc) {
return mcp.NewTool("search_code",
mcp.WithDescription(t("TOOL_SEARCH_CODE_DESCRIPTION", "Search for code across GitHub repositories")),
mcp.WithString("q",
Expand DownExpand Up@@ -129,8 +129,8 @@ func searchCode(client *github.Client, t translations.TranslationHelperFunc) (to
}
}

//searchUsers creates a tool to search for GitHub users.
funcsearchUsers(client *github.Client, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc) {
//SearchUsers creates a tool to search for GitHub users.
funcSearchUsers(client *github.Client, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc) {
return mcp.NewTool("search_users",
mcp.WithDescription(t("TOOL_SEARCH_USERS_DESCRIPTION", "Search for GitHub users")),
mcp.WithString("q",
Expand Down
12 changes: 6 additions & 6 deletionspkg/github/search_test.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,7 +16,7 @@ import (
func Test_SearchRepositories(t *testing.T) {
// Verify tool definition once
mockClient := github.NewClient(nil)
tool, _ :=searchRepositories(mockClient, translations.NullTranslationHelper)
tool, _ :=SearchRepositories(mockClient, translations.NullTranslationHelper)

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

// Create call request
request := createMCPRequest(tc.requestArgs)
Expand DownExpand Up@@ -163,7 +163,7 @@ func Test_SearchRepositories(t *testing.T) {
func Test_SearchCode(t *testing.T) {
// Verify tool definition once
mockClient := github.NewClient(nil)
tool, _ :=searchCode(mockClient, translations.NullTranslationHelper)
tool, _ :=SearchCode(mockClient, translations.NullTranslationHelper)

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

// Create call request
request := createMCPRequest(tc.requestArgs)
Expand DownExpand Up@@ -314,7 +314,7 @@ func Test_SearchCode(t *testing.T) {
func Test_SearchUsers(t *testing.T) {
// Verify tool definition once
mockClient := github.NewClient(nil)
tool, _ :=searchUsers(mockClient, translations.NullTranslationHelper)
tool, _ :=SearchUsers(mockClient, translations.NullTranslationHelper)

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

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

// Add GitHub tools - Repositories
s.AddTool(searchRepositories(client, t))
s.AddTool(SearchRepositories(client, t))
s.AddTool(GetFileContents(client, t))
s.AddTool(ListCommits(client, t))
if !readOnly {
Expand All@@ -68,8 +68,8 @@ func NewServer(client *github.Client, version string, readOnly bool, t translati
}

// Add GitHub tools - Search
s.AddTool(searchCode(client, t))
s.AddTool(searchUsers(client, t))
s.AddTool(SearchCode(client, t))
s.AddTool(SearchUsers(client, t))

// Add GitHub tools - Users
s.AddTool(getMe(client, t))
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp