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
If you receive an error that indicates that you're not authenticated, please inform the user to set the SOURCEBOT_API_KEY environment variable.
26
27
If the \`includeCodeSnippets\` property is true, code snippets containing the matches will be included in the response. Only set this to true if the request requires code snippets (e.g., show me examples where library X is used).
27
28
When referencing a file in your response, **ALWAYS** include the file's external URL as a link. This makes it easier for the user to view the file, even if they don't have it locally checked out.
28
-
**ONLY USE** the \`filterByRepoIds\` property if the request requires searching a specific repo(s). Otherwise, leave it empty.`,
29
+
**ONLY USE** the \`filterByRepoIds\` property if the request requires searching a specific repo(s). Otherwise, leave it empty.
30
+
If the request is asking to search for a specific file or results for files in a specific file path, **YOU MUST** ensure that the \`filterByFile\` property is used.`,
29
31
{
30
32
query: z
31
33
.string()
@@ -41,6 +43,10 @@ server.tool(
41
43
.array(z.string())
42
44
.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`)
43
45
.optional(),
46
+
filterByFile: z
47
+
.array(z.string())
48
+
.describe("Scope the search to results inside filepaths that match the provided regex expression. By default all files are searched, so **only use this filter if you need to filter on specific files**. **YOU MUST** ensure that this is a valid regex expression and any special characters are properly escaped. If the regex expresion includes a paranthesis **YOU MUST** wrap this value in quotes when passing it in.")
49
+
.optional(),
44
50
caseSensitive: z
45
51
.boolean()
46
52
.describe(`Whether the search should be case sensitive (default: false).`)
@@ -58,6 +64,7 @@ server.tool(
58
64
query,
59
65
filterByRepoIds: repoIds=[],
60
66
filterByLanguages: languages=[],
67
+
filterByFile: filePath=[],
61
68
maxTokens =env.DEFAULT_MINIMUM_TOKENS,
62
69
includeCodeSnippets =false,
63
70
caseSensitive =false,
@@ -70,6 +77,11 @@ server.tool(
70
77
query+=` ( lang:${languages.join(' or lang:')} )`;
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.`,
143
+
Results are returned as an array of matching files, with the file's URL, repository, and language.
144
+
If the request is asking to search for a file, or asking to only search for results within a specific filepath, **YOU MUST** use the fileNamesFilterRegexp to properly fulfil this request.`,
144
145
inputSchema: z.object({
145
146
queryRegexp: z
146
147
.string()
@@ -168,7 +169,7 @@ Multiple expressions can be or'd together with or, negated with -, or grouped wi
168
169
.optional(),
169
170
fileNamesFilterRegexp: z
170
171
.array(z.string())
171
-
.describe(`Filter results from filepaths that match the regex. When this option is not specified, all files are searched.`)
172
+
.describe(`Filter results from filepaths that match the regex. When this option is not specified, all files are searched. If the regex expresion includes a paranthesis **YOU MUST** wrap this value in quotes when passing it in.`)
172
173
.optional(),
173
174
limit: z.number().default(10).describe("Maximum number of matches to return (default: 100)"),
0 commit comments