From 73a06f3c94f109c8ec131ea517b55dc2d0281d76 Mon Sep 17 00:00:00 2001 From: moosecrap Date: Tue, 22 Sep 2026 12:51:28 -0700 Subject: [PATCH] Home directory handling --- tools/list_directory.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/list_directory.py b/tools/list_directory.py index bcd3a97..8fb1943 100644 --- a/tools/list_directory.py +++ b/tools/list_directory.py @@ -19,7 +19,7 @@ async def handle(args: Dict[str, Any]): if not path_str: raise ToolError("Missing path argument") - path = Path(path_str) + path = Path(path_str).expanduser() if not path.is_dir(): raise ToolError(f"{path_str} is not a directory.") @@ -59,6 +59,6 @@ async def handle(args: Dict[str, Any]): size_kb = item["size"] / 1024 output.append(f" {item['name']} | {size_kb:.1f}KB | {mtime_rel}") - header = f"Listing of {path_str}\nPage {effective_page} of {total_pages} ({total_items} total items). Showing {start_idx+1}-{min(end_idx, total_items)}." + header = f"Listing of {path}\nPage {effective_page} of {total_pages} ({total_items} total items). Showing {start_idx+1}-{min(end_idx, total_items)}." return [{"type": "text", "text": f"{header}\n\n" + "\n".join(output)}]