Skip to main content
Glama
Microsoft 365 MCP Server

Microsoft 365 MCP Server

by Softeria

delete-mail-folder

delete-mail-folder
Destructive

Delete a specified mail folder and its contents by folder ID or well-known name. Moves the folder to Deleted Items for recovery, not permanent removal.

Instructions

Delete the specified mailFolder. The folder can be a mailSearchFolder. You can specify a mail folder by its folder ID, or by its well-known folder name, if one exists.

šŸ’” TIP: Deletes a mail folder and its contents. Not a permanent delete: the folder goes to Deleted Items and can be restored from there until it is purged. Use list-mail-folders to find the folder ID.

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": {
      "mailFolderId": "<mailFolderId>"
    },
    "name": "delete-mail-folder"
  }
}

Input Schema

NameRequiredDescriptionDefault
confirmNoFor destructive operations when the confirm gate is enabled (MS365_MCP_REQUIRE_CONFIRM=true; off by default). Set to true only after the user has explicitly approved this action. When the gate is on, calls without confirm: true return { error: "confirmation_required" } without touching user data.
If-MatchNoETag
mailFolderIdYesValue for the 'mailFolderId' path segment. Pass it under the name 'mailFolderId', not as 'id'. Use the 'id' field of the mail folder object as returned by Microsoft Graph.
includeHeadersNoInclude response headers (including ETag) in the response metadata
excludeResponseNoExclude the full response body and only return success or failure indication

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.134.4
  2. Removedv0.131.2
  3. Changed1 schema field changedv0.131.1
    • addedInput schema / properties / confirm
      Added value: +{
      +  "description": "For destructive operations when the confirm gate is enabled (MS365_MCP_REQUIRE_CONFIRM=true; off by default). Set to true only after the user has explicitly approved this action. When the gate is on, calls without confirm: true return { error: \"confirmation_required\" } without touching user data.",
      +  "type": "boolean"
      +}
  4. Addedv0.114.0
  5. Removedv0.112.2
  6. Addedv0.110.0
  7. Removedv0.108.0
  8. Addedv0.96.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already flag destructiveHint=true and openWorldHint=true, but the description adds genuinely non-obvious behavior: deletion is soft, the folder lands in Deleted Items, and it remains restorable until purged. It also notes mailSearchFolder support. Remaining gap: no statement about what happens to child folders or messages when a parent folder is deleted.

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?

Front-loaded with the action and scope, then the recoverability tip and the ID-discovery pointer in priority order. There is mild redundancy between "Delete the specified mailFolder" and "Deletes a mail folder and its contents," but the extra sentence carries the restoration nuance rather than pure repetition.

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 single-object operation with no output schema, the description supplies the safety-relevant facts an agent needs: soft delete, recoverability window, valid identifier forms, and a lookup tool for IDs. It could be complete with one line about cascade behavior for child folders or whether the search folder is removed permanently.

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, but the description earns more by disclosing that mailFolderId accepts either a Graph folder ID or a well-known folder name - a detail the schema does not mention, since it only references the 'id' field. The confirm gate and ETag parameters are left entirely to the schema.

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?

States a specific verb and resource ("Delete the specified mailFolder") and adds scope details that separate it from sibling delete tools: the target may be a mailSearchFolder and may be addressed by ID or well-known name. An agent can distinguish this from delete-contact-folder or delete-mail-message without opening a schema.

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

Usage Guidelines4/5

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

Gives concrete routing guidance for the required parameter ("Use list-mail-folders to find the folder ID") and clarifies the action is recoverable rather than permanent. It stops short of stating when not to use this tool or which sibling to choose if the target is a contact folder, so it is clear but not exhaustive.

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