update mcp

This commit is contained in:
bkellam 2025-11-20 17:27:35 -08:00
parent 55a3e9ef6a
commit 93a3f89a70
2 changed files with 13 additions and 16 deletions

View file

@ -70,16 +70,12 @@ server.tool(
query += ` ( lang:${languages.join(' or lang:')} )`; query += ` ( lang:${languages.join(' or lang:')} )`;
} }
if (caseSensitive) {
query += ` case:yes`;
} else {
query += ` case:no`;
}
const response = await search({ const response = await search({
query, query,
matches: env.DEFAULT_MATCHES, matches: env.DEFAULT_MATCHES,
contextLines: env.DEFAULT_CONTEXT_LINES, contextLines: env.DEFAULT_CONTEXT_LINES,
isRegexEnabled: true,
isCaseSensitivityEnabled: caseSensitive,
}); });
if (isServiceError(response)) { if (isServiceError(response)) {

View file

@ -21,15 +21,17 @@ export const symbolSchema = z.object({
kind: z.string(), kind: z.string(),
}); });
export const searchOptionsSchema = z.object({
matches: z.number(), // The number of matches to return.
contextLines: z.number().optional(), // The number of context lines to return.
whole: z.boolean().optional(), // Whether to return the whole file as part of the response.
isRegexEnabled: z.boolean().optional(), // Whether to enable regular expression search.
isCaseSensitivityEnabled: z.boolean().optional(), // Whether to enable case sensitivity.
});
export const searchRequestSchema = z.object({ export const searchRequestSchema = z.object({
// The zoekt query to execute. query: z.string(), // The zoekt query to execute.
query: z.string(), ...searchOptionsSchema.shape,
// The number of matches to return.
matches: z.number(),
// The number of context lines to return.
contextLines: z.number().optional(),
// Whether to return the whole file as part of the response.
whole: z.boolean().optional(),
}); });
export const repositoryInfoSchema = z.object({ export const repositoryInfoSchema = z.object({
@ -109,7 +111,7 @@ export const searchStatsSchema = z.object({
regexpsConsidered: z.number(), regexpsConsidered: z.number(),
// FlushReason explains why results were flushed. // FlushReason explains why results were flushed.
flushReason: z.number(), flushReason: z.string(),
}); });
export const searchResponseSchema = z.object({ export const searchResponseSchema = z.object({
@ -139,7 +141,6 @@ export const searchResponseSchema = z.object({
content: z.string().optional(), content: z.string().optional(),
})), })),
repositoryInfo: z.array(repositoryInfoSchema), repositoryInfo: z.array(repositoryInfoSchema),
isBranchFilteringEnabled: z.boolean(),
isSearchExhaustive: z.boolean(), isSearchExhaustive: z.boolean(),
}); });