Skip to main content
Glama

Delete a file or directory in a sandbox

delete_file
DestructiveIdempotent

Delete a file or directory inside a sandbox; use recursive=true for directories, while symlinks are removed without affecting their targets.

Instructions

Delete a file or directory in a sandbox. A directory needs recursive=true. A symlink is deleted itself, never its target. /home/user and /tmp themselves cannot be deleted. Needs file.write.

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": {
      "sandboxId": "<sandboxId>",
      "path": "<path>"
    },
    "name": "delete_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYes
recursiveNo
sandboxIdYesPublic Sandbox id returned by create/list/get sandbox calls.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare destructive/readOnly/idempotent, so the description's job is the extra behavior, and it delivers: symlinks are removed without touching the target, recursive is mandatory for directories, and two protected roots exist. It stops short of saying whether deletion is irreversible or how a non-empty directory without recursive fails.

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

Conciseness5/5

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

Four short sentences, front-loaded with the action, then the directory rule, the symlink rule, the protected paths, and the permission requirement. No filler and nothing repeated from the schema.

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?

For a destructive three-parameter tool with no output schema, it covers the key edge cases (symlinks, protected roots, recursive requirement) and the auth requirement (file.write). Only failure modes and irreversibility remain unstated.

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

Parameters4/5

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

Schema coverage is only 33% (sandboxId is the only documented parameter), so the description must compensate, and it does: it explains what path may and may not point to and the exact semantics of the undocumented recursive flag. Format details for path are still absent.

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

Purpose4/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 directory in a sandbox'), which implicitly distinguishes it from delete_sandbox and the snapshot deleters. Sibling differentiation is inferable from the wording but never made explicit.

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

Usage Guidelines3/5

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

Gives conditional usage guidance ('a directory needs recursive=true') and two hard exclusions (/home/user and /tmp cannot be deleted), but never says when to prefer this over delete_sandbox or how it relates to the other delete tools.

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