Skip to main content
Glama

Delete file or directory

delete_path
Destructive

Delete a file or a directory in the sandbox; a directory is removed with everything in it unless recursive=false (then only an empty one). Use it to clean up before running something again or to free disk space – the deletion cannot be undone. A path that does not exist returns an error and / cannot be removed. No separate mkdir is needed: writing a file creates its missing parent directories (for an empty directory run mkdir -p as a shell command).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "path": "<path>"
    },
    "name": "delete_path"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesAbsolute path of the file or directory, e.g. /home/user/build
recursiveNoRemove a directory with its contents (default true); false removes only an empty directory.
sandbox_idNoSandbox ID (sb_…). If omitted, the current sandbox of this session is used. A sandbox_id you pass becomes the current sandbox for later calls without sandbox_id.

Output Schema

NameRequiredDescriptionDefault
pathYesThe deleted path.
deletedYesThe path was deleted.
sandbox_idYesSandbox ID.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / sandbox_id / description
      Previous value: -"Sandbox ID (sb_…). If omitted, the current sandbox of this session is used."New value: +"Sandbox ID (sb_…). If omitted, the current sandbox of this session is used. A sandbox_id you pass becomes the current sandbox for later calls without sandbox_id."
  2. Added

TDQS

A4.3/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare destructiveHint=true and readOnlyHint=false, but the description adds critical behavior: deletion cannot be undone, a missing path returns an error, and '/' cannot be removed. It also clarifies that recursion is the default, so a careless call removes contents, which is exactly the risk an agent must know.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads the core action and the recursive caveat, then adds usage and irreversibility. The final mkdir sentence is somewhat tangential to deletion but earns a place by preventing a setup error; overall tight with no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Output schema exists, so return values need no explanation, and the description covers irreversibility, error behavior, root protection, and the recursion default. It omits that a passed sandbox_id becomes the session's current sandbox, but that lives in the schema, so it is a minor gap for a destructive operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and the description largely restates the schema's recursive semantics ('unless recursive=false (then only an empty one)') and the absolute-path requirement. The mkdir workflow note adds minor value, but no new meaning beyond the structured fields.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Delete a file or a directory in the sandbox') and immediately distinguishes the two modes via the recursive flag. An agent can tell this apart from read_file/write_file/list_files without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives concrete when-to-use guidance: clean up before re-running something, or free disk space. It also heads off a common wrong turn by explaining that no separate mkdir is needed. It does not name an alternative sibling, but no sibling performs deletion, so the gap is small.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources