From 1386c38b14b333016263a65c7da66a001b84040e Mon Sep 17 00:00:00 2001 From: Marco Beretta <81851188+berry-13@users.noreply.github.com> Date: Sat, 31 May 2025 20:53:12 +0200 Subject: [PATCH] refactor: correct type definitions for ToolInputSchema and error handling in searchFiles function --- packages/mcp/src/examples/filesystem.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/mcp/src/examples/filesystem.ts b/packages/mcp/src/examples/filesystem.ts index 1bbf01d5db..81ede0a26a 100644 --- a/packages/mcp/src/examples/filesystem.ts +++ b/packages/mcp/src/examples/filesystem.ts @@ -162,8 +162,8 @@ const GetFileInfoArgsSchema = z.object({ path: z.string(), }); -const ToolInputSchema = ToolSchema.shape.inputSchema; -type ToolInput = z.infer; +type ToolInputSchema = typeof ToolSchema.shape.inputSchema; +type ToolInput = z.infer; interface FileInfo { size: number; @@ -237,7 +237,7 @@ async function searchFiles( if (entry.isDirectory()) { await search(fullPath); } - } catch (error) { + } catch { // Skip invalid paths during search continue; }