File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -163,17 +163,16 @@ const server = new Server(
163
163
} ,
164
164
{
165
165
capabilities : {
166
- tools : [
167
- {
168
- name : "search_files" ,
166
+ tools : {
167
+ search_files : {
169
168
description : "Recursively search for files/directories with optional exclude patterns" ,
170
169
inputSchema : zodToJsonSchema ( SearchFilesArgsSchema ) ,
171
170
handler : async ( args : z . infer < typeof SearchFilesArgsSchema > ) => {
172
171
const validatedPath = await validatePath ( args . path ) ;
173
172
return searchFiles ( validatedPath , args . pattern , args . excludePatterns ) ;
174
173
} ,
175
174
} ,
176
- ] ,
175
+ } ,
177
176
} ,
178
177
} ,
179
178
) ;
@@ -546,7 +545,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
546
545
throw new Error ( `Invalid arguments for search_files: ${ parsed . error } ` ) ;
547
546
}
548
547
const validPath = await validatePath ( parsed . data . path ) ;
549
- const results = await searchFiles ( validPath , parsed . data . pattern ) ;
548
+ const results = await searchFiles ( validPath , parsed . data . pattern , parsed . data . excludePatterns ) ;
550
549
return {
551
550
content : [ { type : "text" , text : results . length > 0 ? results . join ( "\n" ) : "No matches found" } ] ,
552
551
} ;
@@ -568,9 +567,9 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
568
567
569
568
case "list_allowed_directories" : {
570
569
return {
571
- content : [ {
572
- type : "text" ,
573
- text : `Allowed directories:\n${ allowedDirectories . join ( '\n' ) } `
570
+ content : [ {
571
+ type : "text" ,
572
+ text : `Allowed directories:\n${ allowedDirectories . join ( '\n' ) } `
574
573
} ] ,
575
574
} ;
576
575
}
You can’t perform that action at this time.
0 commit comments