Home directory handling
This commit is contained in:
@@ -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)}]
|
||||
|
||||
Reference in New Issue
Block a user