Skip to main content
Glama

file_delete

Destructive

Permanently removes one or more workspace files, reporting per-file success or errors; use after code_callers or code_grep confirms nothing references them.

Instructions

Deletes one or more files from a workspace for good: no backup and no recycle bin; only git can bring back a tracked file. Each file is handled on its own, so some can succeed while others fail. A missing file is an error for that entry; a folder path is refused (use folder_delete). At most 50 paths per call. BLOCKED: files in restricted folders (bin, obj, .git and the like), files that hold secrets, keys or databases, and anything the workspace's access rules hide. Saved flows whose steps lived in a deleted file are named in the reply, to update with memorise. WHEN TO USE: removing files that are no longer needed, after code_callers or code_grep shows nothing still uses them. To rename or move instead use file_move; to empty a file use file_write. RETURNS: one line per file: deleted, or the error.

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": {
      "workspace": "<workspace>",
      "pathsJson": "<pathsJson>"
    },
    "name": "file_delete"
  }
}

Input Schema

NameRequiredDescriptionDefault
guideNotrue: put the files guide first in the result. Use on your first files call, or when told it changed.
pathsJsonYesJSON array of file paths relative to the workspace root: ["Services/OldService.cs", "Services/IOldService.cs"]. Files only, no folders or wildcards.
workspaceYesWorkspace name as shown in Waymark (a single workspace; '*' is not accepted)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.2.2
    • changedInput schema / properties / pathsJson / description
      Previous value: -"JSON array of relative file paths to delete:\n  [\"Services/OldService.cs\", \"Services/IOldService.cs\"]"New value: +"JSON array of file paths relative to the workspace root: [\"Services/OldService.cs\", \"Services/IOldService.cs\"]. Files only, no folders or wildcards."
  2. Addedv0.2.1

TDQS

A4.9/5.0
Behavior5/5

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

Annotations only declare destructive/not-idempotent; the description adds substantial context beyond them: no backup or recycle bin, git as the sole recovery path for tracked files, per-entry independence so partial success is possible, missing-path and folder-path failure modes, and a BLOCKED list covering restricted folders, secrets/keys/databases and access-rule-hidden files. It also discloses a side effect (named saved flows in the reply) that no annotation could express.

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?

Front-loaded with the irreversible consequence, then structured into BLOCKED / WHEN TO USE / RETURNS sections. Dense but every sentence carries an operational fact; there is no filler or restatement of the tool name.

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

Completeness5/5

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

No output schema exists, and the RETURNS line covers the response shape (one line per file: deleted or the error). Combined with the blocked-content rules, failure semantics for deletes, missing paths and folders, and the recovery caveat, an agent has everything needed to call this destructive tool correctly.

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 100%, so the baseline is 3; the description still adds real meaning by imposing a 50-path cap on pathsJson and defining per-entry error semantics for missing files and refused folder paths. It says nothing extra about the optional guide flag, keeping it from a 5.

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?

Opens with a specific verb and resource plus a consequence qualifier ("Deletes one or more files from a workspace for good"), and immediately establishes scope against siblings by refusing folder paths and naming folder_delete. An agent can distinguish this from folder_delete, file_move and file_write without inspecting 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 Guidelines5/5

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

A dedicated WHEN TO USE block gives the positive case (files no longer needed, after code_callers or code_grep confirms nothing uses them) and names explicit alternatives with their trigger conditions: file_move for rename/move, file_write for emptying, folder_delete for folders. Exclusions and the 50-path cap are stated outright, so nothing is left to inference.

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