diff --git a/sdk/src/tools/list-directory.ts b/sdk/src/tools/list-directory.ts index 37c61fed1..e7a1bd6fc 100644 --- a/sdk/src/tools/list-directory.ts +++ b/sdk/src/tools/list-directory.ts @@ -13,7 +13,10 @@ export async function listDirectory(params: { try { const resolvedPath = path.resolve(projectPath, directoryPath) - if (!resolvedPath.startsWith(projectPath)) { + if ( + !resolvedPath.startsWith(projectPath + path.sep) && + resolvedPath !== projectPath + ) { return [ { type: 'json',