Skip to content

Commit 84ee8d3

Browse files
authored
Changed q to query in search
1 parent 7a9bc91 commit 84ee8d3

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,7 @@ The following sets of tools are available (all are on by default):
836836
- `order`: Sort order (string, optional)
837837
- `page`: Page number for pagination (min 1) (number, optional)
838838
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
839-
- `q`: Search query using GitHub code search syntax (string, required)
839+
- `query`: Search query using GitHub code search syntax (string, required)
840840
- `sort`: Sort field ('indexed' only) (string, optional)
841841

842842
- **search_repositories** - Search repositories

pkg/github/__toolsnaps__/search_code.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"minimum": 1,
2626
"type": "number"
2727
},
28-
"q": {
28+
"query": {
2929
"description": "Search query using GitHub code search syntax",
3030
"type": "string"
3131
},
@@ -35,7 +35,7 @@
3535
}
3636
},
3737
"required": [
38-
"q"
38+
"query"
3939
],
4040
"type": "object"
4141
},

pkg/github/search.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func SearchCode(getClient GetClientFn, t translations.TranslationHelperFunc) (to
8383
Title: t("TOOL_SEARCH_CODE_USER_TITLE", "Search code"),
8484
ReadOnlyHint: ToBoolPtr(true),
8585
}),
86-
mcp.WithString("q",
86+
mcp.WithString("query",
8787
mcp.Required(),
8888
mcp.Description("Search query using GitHub code search syntax"),
8989
),
@@ -97,7 +97,7 @@ func SearchCode(getClient GetClientFn, t translations.TranslationHelperFunc) (to
9797
WithPagination(),
9898
),
9999
func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) {
100-
query, err := RequiredParam[string](request, "q")
100+
query, err := RequiredParam[string](request, "query")
101101
if err != nil {
102102
return mcp.NewToolResultError(err.Error()), nil
103103
}

pkg/github/search_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,12 @@ func Test_SearchCode(t *testing.T) {
173173

174174
assert.Equal(t, "search_code", tool.Name)
175175
assert.NotEmpty(t, tool.Description)
176-
assert.Contains(t, tool.InputSchema.Properties, "q")
176+
assert.Contains(t, tool.InputSchema.Properties, "query")
177177
assert.Contains(t, tool.InputSchema.Properties, "sort")
178178
assert.Contains(t, tool.InputSchema.Properties, "order")
179179
assert.Contains(t, tool.InputSchema.Properties, "perPage")
180180
assert.Contains(t, tool.InputSchema.Properties, "page")
181-
assert.ElementsMatch(t, tool.InputSchema.Required, []string{"q"})
181+
assert.ElementsMatch(t, tool.InputSchema.Required, []string{"query"})
182182

183183
// Setup mock search results
184184
mockSearchResult := &github.CodeSearchResult{
@@ -227,7 +227,7 @@ func Test_SearchCode(t *testing.T) {
227227
),
228228
),
229229
requestArgs: map[string]interface{}{
230-
"q": "fmt.Println language:go",
230+
"query": "fmt.Println language:go",
231231
"sort": "indexed",
232232
"order": "desc",
233233
"page": float64(1),
@@ -251,7 +251,7 @@ func Test_SearchCode(t *testing.T) {
251251
),
252252
),
253253
requestArgs: map[string]interface{}{
254-
"q": "fmt.Println language:go",
254+
"query": "fmt.Println language:go",
255255
},
256256
expectError: false,
257257
expectedResult: mockSearchResult,
@@ -268,7 +268,7 @@ func Test_SearchCode(t *testing.T) {
268268
),
269269
),
270270
requestArgs: map[string]interface{}{
271-
"q": "invalid:query",
271+
"query": "invalid:query",
272272
},
273273
expectError: true,
274274
expectedErrMsg: "failed to search code",

0 commit comments

Comments
 (0)