@@ -121,6 +121,14 @@ func (l *lsTool) Run(ctx context.Context, call ToolCall) (ToolResponse, error) {
121 searchPath = l.workingDir
121 searchPath = l.workingDir
124+ if searchPath == "~" {
125+ homeDir, err := os.UserHomeDir()
127+ return ToolResponse{}, fmt.Errorf("error resolving home directory: %w", err)
129+ searchPath = homeDir
124 if !filepath.IsAbs(searchPath) {
132 if !filepath.IsAbs(searchPath) {
125 searchPath = filepath.Join(l.workingDir, searchPath)
133 searchPath = filepath.Join(l.workingDir, searchPath)