Skip to main content
Glama

Delete file

delete_file
DestructiveIdempotent

Deletes a batch file or bound image/reference file by its Files API file ID. Use it to remove stored files from a workspace or Anthropic Files API mode.

Instructions

Deletes a batch file or a bound image/reference file. When the request includes anthropic-beta: files-api-2025-04-14, the route uses Anthropic Files API mode for the bound workspace.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_idYesFile ID returned by the Files API.
anthropic-betaNoInclude files-api-2025-04-14 to use Anthropic Files API mode.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.6.4
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • addedInput schema / properties / anthropic-beta
      Added value: +{
      +  "description": "Include files-api-2025-04-14 to use Anthropic Files API mode.",
      +  "type": "string"
      +}
  2. Addedv0.3.1

TDQS

B3.2/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true, idempotentHint=true, and readOnlyHint=false, so the safety profile is covered. The description adds useful context about which file classes can be deleted and the Anthropic Files API routing, but says nothing about permanence, error conditions, or side effects beyond what annotations imply.

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?

Two sentences with the action front-loaded and no filler. The routing caveat is compact and earns its place, though the second sentence could be slightly tighter.

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 tool whose annotations already carry the safety profile and with no output schema expected, the description adequately covers the deletion targets and the mode-dependent behavior. Nothing critical to correct invocation is missing.

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 description coverage is 100%, so both parameters (file_id and anthropic-beta) are already documented in the schema. The description explains the behavioral effect of anthropic-beta, which adds marginal value, but the baseline 3 applies when the schema does the heavy lifting.

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 (Deletes) and resource (batch file or bound image/reference file), clearly distinguishing the target from adjacent siblings like retrieve_file or upload_file. It is clear what the tool does, though it doesn't explicitly contrast itself with the other file-lifecycle tools.

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

Usage Guidelines2/5

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

There is no guidance on when to choose this tool over siblings such as retrieve_file or edit_image_file, nor any stated prerequisites or exclusions. The only conditional detail is the anthropic-beta routing behavior, which is a mode switch rather than usage guidance.

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