You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: `Fetches code that matches the provided regex pattern in \`query\`. This is NOT a semantic search.
143
-
Results are returned as an array of matching files, with the file's URL, repository, and language.`,
144
+
description: `Searches for code that matches the provided search query as a substring by default, or as a regular expression if useRegex is true. Useful for exploring remote repositories by searching for exact symbols, functions, variables, or specific code patterns. To determine if a repository is indexed, use the \`listRepos\` tool. By default, searches are global and will search the default branch of all repositories. Searches can be scoped to specific repositories, languages, and branches.`,
144
145
inputSchema: z.object({
145
-
queryRegexp: z
146
+
query: z
146
147
.string()
147
-
.describe(`The regex pattern to search for in the code.
148
-
149
-
Queries consist of space-seperated regular expressions. Wrapping expressions in "" combines them. By default, a file must have at least one match for each expression to be included. Examples:
150
-
151
-
\`foo\` - Match files with regex /foo/
152
-
\`foo bar\` - Match files with regex /foo/ and /bar/
153
-
\`"foo bar"\` - Match files with regex /foo bar/
154
-
\`console.log\` - Match files with regex /console.log/
155
-
156
-
Multiple expressions can be or'd together with or, negated with -, or grouped with (). Examples:
157
-
\`foo or bar\` - Match files with regex /foo/ or /bar/
158
-
\`foo -bar\` - Match files with regex /foo/ but not /bar/
159
-
\`foo (bar or baz)\` - Match files with regex /foo/ and either /bar/ or /baz/
160
-
`),
161
-
repoNamesFilterRegexp: z
148
+
.describe(`The search pattern to match against code contents. Do not escape quotes in your query.`)
149
+
// Escape backslashes first, then quotes, and wrap in double quotes
150
+
// so the query is treated as a literal phrase (like grep).
.describe(`Whether to use regular expression matching to match the search query against code contents. When false, substring matching is used. (default: false)`)
158
+
.optional(),
159
+
filterByRepos: z
162
160
.array(z.string())
163
-
.describe(`Filter results from repos that match the regex. By default all repos are searched.`)
161
+
.describe(`Scope the search to the provided repositories.`)
164
162
.optional(),
165
-
languageNamesFilter: z
163
+
filterByLanguages: z
166
164
.array(z.string())
167
-
.describe(`Scope the search to the provided languages. The language MUST be formatted as a GitHub linguist language. Examples: Python, JavaScript, TypeScript, Java, C#, C++, PHP, Go, Rust, Ruby, Swift, Kotlin, Shell, C, Dart, HTML, CSS, PowerShell, SQL, R`)
165
+
.describe(`Scope the search to the provided languages.`)
168
166
.optional(),
169
-
fileNamesFilterRegexp: z
167
+
filterByFilepaths: z
170
168
.array(z.string())
171
-
.describe(`Filter results from filepaths that match the regex. When this option is not specified, all files are searched.`)
169
+
.describe(`Scope the search to the provided filepaths.`)
170
+
.optional(),
171
+
caseSensitive: z
172
+
.boolean()
173
+
.describe(`Whether the search should be case sensitive (default: false).`)
174
+
.optional(),
175
+
ref: z
176
+
.string()
177
+
.describe(`Commit SHA, branch or tag name to search on. If not provided, defaults to the default branch (usually 'main' or 'master').`)
178
+
.optional(),
179
+
limit: z
180
+
.number()
181
+
.default(DEFAULT_SEARCH_LIMIT)
182
+
.describe(`Maximum number of matches to return (default: ${DEFAULT_SEARCH_LIMIT})`)
172
183
.optional(),
173
-
limit: z.number().default(10).describe("Maximum number of matches to return (default: 100)"),
0 commit comments