Merge pull request #1540 from jaffarkeikei/fix/list-dir-isdir-check

fix(list_dir): add isdir check before listing
This commit is contained in:
Bryan @ Aden
2026-01-27 19:17:25 -08:00
committed by GitHub
@@ -36,7 +36,10 @@ def register_tools(mcp: FastMCP) -> None:
try:
secure_path = get_secure_path(path, workspace_id, agent_id, session_id)
if not os.path.exists(secure_path):
return {"error": f"Directory not found at {path}"}
return {"error": f"Path not found: {path}"}
if not os.path.isdir(secure_path):
return {"error": f"Path is not a directory: {path}"}
items = os.listdir(secure_path)
entries = []