Skip to Content

fs_delete

Remove a file or folder by moving it to the user’s trash (macOS ~/.Trash, Linux the freedesktop trash), so the owner can put it back. A non-empty folder needs recursive=true. permanent=true removes for good and cannot be undone. The home folder, the file system root and the machine’s allowed roots themselves are refused, as are paths holding keys and credentials.

Arguments

Over MCP every tool also takes machine: the machine’s name or id, optional when only one machine is online.

NameTypeRequiredMeaning
pathstringyesFile or folder on the machine. Absolute, or relative to the user’s home folder.
permanentbooleannoRemove for good instead of moving to the trash. Only where the trash cannot take it. Default: false.
recursivebooleannoAllow a folder that is not empty. Default: false.

Result

NameTypeRequiredMeaning
pathstringyes
trashed_tostringnoWhere it went in the trash; absent when removed for good.

Examples

{ "name": "fs_delete", "arguments": { "machine": "<machine>", "path": "<path>" } }

Limits

The call times out after 120 s (timed_out). Available since version 0.0.1. A refused or failed call returns one of the error codes.