From 50dc9b9367c97601c2239ed4733dc7c6a91545b7 Mon Sep 17 00:00:00 2001 From: Will-hxw Date: Wed, 29 Apr 2026 07:31:27 +0800 Subject: [PATCH] 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 --- pkg/github/search.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/github/search.go b/pkg/github/search.go index d5ddb4a72a..d3b954b715 100644 --- a/pkg/github/search.go +++ b/pkg/github/search.go @@ -173,7 +173,7 @@ func SearchCode(t translations.TranslationHelperFunc) inventory.ServerTool { Properties: map[string]*jsonschema.Schema{ "query": { Type: "string", - 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.", + 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'.", }, "sort": { Type: "string",