fs.delete

The fs.delete tool deletes a file within the agent's capability-scoped paths.

Capabilities Required

tool.invoke:fs.delete
fs.write:<path-glob>

Deletion requires write access to the path (checked against fs.write capabilities).

Input Schema

{
  "type": "object",
  "required": ["path"],
  "properties": {
    "path": {
      "type": "string",
      "description": "Absolute path to the file to delete."
    }
  }
}

Output Schema

{
  "type": "object",
  "properties": {
    "deleted": { "type": "boolean", "description": "true if the file was deleted." }
  }
}

Examples

#![allow(unused)]
fn main() {
let result = agent.invoke_tool("fs.delete", json!({
    "path": "/workspace/temp.txt"
})).await?;

if result["deleted"].as_bool().unwrap_or(false) {
    println!("File deleted");
} else {
    println!("File not found (already deleted or never existed)");
}
}
ash tools invoke <agent-id> fs.delete '{"path": "/workspace/temp.txt"}'

Workspace Isolation

Deletions only affect the agent's overlayfs upper layer. A "deletion" of a base-layer file creates a whiteout entry; the file appears deleted to the agent but the base is unchanged.

Cost

Estimated cost: 0.1

Error Cases

ErrorCause
access denied: fs.write:/pathPath not in declared write scopes
is a directoryUse directory removal (not yet supported)

Note on Non-Existent Files

Deleting a file that does not exist returns {"deleted": false} rather than an error.