Skip to main content
Glama

files.delete

Delete obsolete files permanently by ID (max 500 per call). Removes from storage and search index, with per-ID error isolation so partial batches still succeed.

Instructions

DESTRUCTIVE. Permanently delete one or more files by ID (up to 500 per call). Pass a single-element ids array for the one-file case. KB files are unlinked from disk AND removed from the FTS5 index; project reference files only have their index entry removed (the file on disk is left alone so the watcher does not fight your editor). Not idempotent — deleting an unknown ID surfaces as a per-item error. No external auth or rate limits. Per-ID failures are isolated to errors[] and the rest of the batch still commits — partial success is the norm, always inspect error_count. Returns {deleted_count, error_count, deleted, errors}. Use only when the file is truly obsolete; to deprioritise without losing data, untag (tags.remove) or unfavorite (tags.set_favorite) instead. To preview the set before deleting, run files.list with the same filter and confirm the IDs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idsYesFile IDs to delete. Single-element array = one-file case. Max 500 per call.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv5.0.0
    • removedInput schema / properties / id
      Removed value: -{
      -  "description": "File ID",
      -  "type": "number"
      -}
    • addedInput schema / properties / ids
      Added value: +{
      +  "description": "File IDs to delete. Single-element array = one-file case. Max 500 per call.",
      +  "items": {
      +    "type": "number"
      +  },
      +  "maxItems": 500,
      +  "minItems": 1,
      +  "type": "array"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "id"
      -]New value: +[
      +  "ids"
      +]
  2. Addedv4.7.2

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden and does so thoroughly. It discloses destructive permanence, the non-idempotent behavior, per-item error isolation, partial-success semantics, the exact return shape, and the difference between KB file deletion (disk + FTS5 index) and project reference file deletion (index only). It also notes no external auth or rate limits. This is rich behavioral context beyond what any schema could convey.

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?

The description is dense but every sentence earns its place: destructive warning, batch limit, file-type behavior, non-idempotence, error isolation, return shape, and alternatives. It is front-loaded with the DESTRUCTIVE warning. It is longer than the HIGH calibration example, but the tool's complexity justifies the length; still, a couple of clauses could be tightened.

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?

For a destructive batch mutation with no annotations and no output schema, the description is complete: it covers the return shape, error semantics, partial success, file-type differences, and safe alternatives. An agent has everything needed to invoke it correctly and to decide whether to call it at all.

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 schema already documents the ids array, min/max items, and the single-element case. The description reinforces the single-element array point and adds the 500-per-call limit, but it does not add meaning beyond what the schema already provides. Baseline 3 is appropriate.

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?

The description states a specific verb ('Permanently delete'), a resource ('one or more files by ID'), and a concrete scope (up to 500 per call). It also distinguishes the two file types (KB files vs project reference files) and explicitly contrasts with sibling tools like tags.remove and files.list, so an agent can tell it apart without opening the 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?

The description explicitly says when to use this tool ('Use only when the file is truly obsolete') and when not to ('to deprioritise without losing data, untag or unfavorite instead'). It also names the alternative tools (tags.remove, tags.set_favorite) and gives a preview workflow via files.list. This is explicit when/when-not guidance.

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