Skip to main content
Glama

Delete File or Folder

delete_drive_item
Destructive

Delete a file or folder from OneDrive or a SharePoint document library so it moves to the recycle bin with its contents and can be restored.

Instructions

Delete a file or folder in OneDrive or a SharePoint document library. It goes to the recycle bin, with a folder's contents, and can be restored from there.

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": {
      "item_id": "<item_id>"
    },
    "name": "delete_drive_item"
  }
}

Input Schema

NameRequiredDescriptionDefault
item_idYesID of the file or folder to delete
drive_idNoSharePoint document library ID from list_site_drives. Omit for your own OneDrive
if_matchNoeTag from get_drive_item or list_drive_items. The change happens only if the item hasn't changed since; otherwise it fails with precondition-failed and nothing changes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.6.1

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, and the description adds genuinely new behavior: deletion is soft (recycle bin), it recurses into a folder's contents, and it is reversible from the recycle bin. That is exactly the context an agent needs before calling a destructive tool. It does not discuss permissions requirements or failure behavior beyond what the schema's if_match description covers.

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?

Two tight sentences with no filler; the operation and its destructive scope are front-loaded and the recoverability caveat follows immediately. Every clause earns its place.

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 3-parameter destructive mutation with full schema coverage and annotations, the description supplies the essential missing piece — that deletion is recursive and recoverable. Minor omissions such as permission requirements or not-found behavior are acceptable given the annotations and rich schema text.

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%, including a detailed if_match concurrency explanation and a pointer to list_site_drives for drive_id, so the schema carries the parameter burden. The description itself adds no parameter-level meaning, making the baseline 3 correct.

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 (delete) plus resource (file or folder) and scopes it to OneDrive or a SharePoint document library, which separates it from move/rename/copy siblings by verb. It stops short of naming any alternative tool explicitly, so it lands just below the top band.

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?

The recycle-bin/restorable framing implicitly answers 'is this safe to use here', which is useful decision context for a destructive operation. However, there is no explicit when-to-use versus when-not guidance, no mention of prerequisites or which alternative to pick if the item should be moved or renamed instead.

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

Deploy Server

Other Tools