File tree Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -442,6 +442,18 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
442
442
const { name, arguments : args } = request . params ;
443
443
444
444
switch ( name ) {
445
+ case "search_files" : {
446
+ const parsed = SearchFilesArgsSchema . safeParse ( args ) ;
447
+ if ( ! parsed . success ) {
448
+ throw new Error ( `Invalid arguments for search_files: ${ parsed . error } ` ) ;
449
+ }
450
+ const validPath = await validatePath ( parsed . data . path ) ;
451
+ const results = await searchFiles ( validPath , parsed . data . pattern , parsed . data . excludePatterns ) ;
452
+ return {
453
+ content : [ { type : "text" , text : results . length > 0 ? results . join ( "\n" ) : "No matches found" } ] ,
454
+ } ;
455
+ }
456
+
445
457
case "read_file" : {
446
458
const parsed = ReadFileArgsSchema . safeParse ( args ) ;
447
459
if ( ! parsed . success ) {
@@ -540,18 +552,6 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
540
552
} ;
541
553
}
542
554
543
- case "search_files" : {
544
- const parsed = SearchFilesArgsSchema . safeParse ( args ) ;
545
- if ( ! parsed . success ) {
546
- throw new Error ( `Invalid arguments for search_files: ${ parsed . error } ` ) ;
547
- }
548
- const validPath = await validatePath ( parsed . data . path ) ;
549
- const results = await searchFiles ( validPath , parsed . data . pattern , parsed . data . excludePatterns ) ;
550
- return {
551
- content : [ { type : "text" , text : results . length > 0 ? results . join ( "\n" ) : "No matches found" } ] ,
552
- } ;
553
- }
554
-
555
555
case "get_file_info" : {
556
556
const parsed = GetFileInfoArgsSchema . safeParse ( args ) ;
557
557
if ( ! parsed . success ) {
You can’t perform that action at this time.
0 commit comments