Skip to main content
Glama
Microsoft 365 MCP Server

Microsoft 365 MCP Server

by Softeria

delete-mail-message

delete-mail-message
Destructive

Deletes an Outlook email by message ID and moves it to Deleted Items, where the user can see and restore it. Use it for standard Outlook-style deletion.

Instructions

Delete an Outlook email message by its message ID, the way Delete in Outlook does: the message moves to the Deleted Items folder, where the user can see and restore it. Returns the moved message, which has a new id. A message already in Deleted Items stays there; to remove it from Deleted Items, use delete-mail-message-skip-deleted-items.

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

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.
messageIdYesValue for the 'messageId' path segment. Pass it under the name 'messageId', not as 'id'. Use the 'id' field of the message 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. Changed1 schema field changedv0.181.0
    • removedInput schema / properties / If-Match
      Removed value: -{
      -  "description": "ETag",
      -  "type": "string"
      -}
  2. Changed1 schema field changedv0.134.4
    • changedInput schema / properties / messageId / description
      Previous value: -"Path parameter: messageId"New value: +"Value for the 'messageId' path segment. Pass it under the name 'messageId', not as 'id'. Use the 'id' field of the message object as returned by Microsoft Graph."
  3. Changed1 schema field changedv0.131.2
    • changedInput schema / additionalProperties
      Previous value: -falseNew value: +true
  4. 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"
      +}
  5. Addedv0.114.0
  6. Removedv0.112.2
  7. Addedv0.110.0
  8. Removedv0.108.0
  9. First observedv0.31.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations declare destructiveHint=true and readOnlyHint=false, which on its own could lead an agent to assume an irreversible purge. The description corrects that impression by disclosing the actual behavior: the message is moved to Deleted Items and is user-restorable, and the returned message carries a new id. That id-change detail is exactly the kind of post-mutation side effect an agent needs before chaining follow-up calls.

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?

Three sentences, front-loaded with the verb and resource, then the recoverable-delete semantics, then the sibling routing. Every sentence carries distinct information: no restating the title, no filler, no repetition of schema content.

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 four-parameter mutation with no output schema, the description covers what would otherwise be gaps: reversibility, the shape of the return (the moved message with a new id), and behavior on already-deleted messages. Combined with annotations and the fully described schema, an agent has everything needed to call it 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 confirm, includeHeaders, and excludeResponse parameters are already fully documented in the schema. The description adds a modest amount beyond that by framing messageId as the identifier taken from the message object and by noting that the id changes after the move, which affects reuse of the value. It does not address the confirm gate, but the schema handles that thoroughly.

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 names a specific verb and resource ("Delete an Outlook email message by its message ID") and immediately qualifies the semantics: this is a soft delete that moves the message to Deleted Items rather than purging it. It explicitly differentiates itself from the sibling delete-mail-message-skip-deleted-items, so an agent can choose between the two without opening either 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?

It states the when (recoverable delete that a user can undo from Deleted Items) and routes the when-not case to a named alternative: "to remove it from Deleted Items, use delete-mail-message-skip-deleted-items." It also covers the edge case of a message already in Deleted Items, so there is no ambiguity about repeated invocation.

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