Skip to content

Commit 50dc9b9

Browse files
committed
docs(search): improve search_code query description to prevent 422 errors
The previous description gave AI models insufficient guidance on GitHub code search syntax, leading to common mistakes like: - Using \| instead of /...|.../ for regex OR - Confusing filename: with path: qualifiers - Misunderstanding boolean operator precedence The new description explicitly documents: - Qualifiers: repo:, org:, language:, path:, path:/regex/, symbol:, content:, is: - Boolean operators: AND, OR, NOT, parentheses - Regex syntax: surround with slashes e.g. /foo|bar/ - Glob patterns in path: path:*.ts, path:/src/**/*.js Fixes #2390
1 parent 4bded57 commit 50dc9b9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pkg/github/search.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ func SearchCode(t translations.TranslationHelperFunc) inventory.ServerTool {
173173
Properties: map[string]*jsonschema.Schema{
174174
"query": {
175175
Type: "string",
176-
Description: "Search query using GitHub's powerful code search syntax. Examples: 'content:Skill language:Java org:github', 'NOT is:archived language:Python OR language:go', 'repo:github/github-mcp-server'. Supports exact matching, language filters, path filters, and more.",
176+
Description: "Search query using GitHub code search syntax. Qualifiers: repo:owner/repo, org:name, language:Go, path:src/*.js, path:/regex/, symbol:Name, content:term, is:archived|fork. Boolean: AND, OR, NOT, parentheses. Regex: surround with slashes e.g. /sparse.*index/. Glob in path: path:*.ts, path:/src/**/*.js. Examples: 'MyFunc language:go repo:owner/repo', 'symbol:WithContext language:go', '/GetAttributes|SetAttributes/ repo:owner/repo', '(Foo OR Bar) path:src repo:owner/repo'.",
177177
},
178178
"sort": {
179179
Type: "string",

0 commit comments

Comments
 (0)