Getting the parent folder

You can use getEntryFromUrl() and pass it an appropriately mutated version of the entry’s nativePath.
Here’s an similar example - note the need for manifest v5 and the appropriate access permissions set there in.