delete_email
Remove unwanted emails from Outlook using the specified email and account IDs. Simplifies email management by enabling direct deletion through integrated Microsoft Graph API commands.
Instructions
Delete an email
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": {
"email_id": "<email_id>",
"account_id": "<account_id>"
},
"name": "delete_email"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| account_id | Yes | ||
| email_id | Yes |
Implementation Reference
- src/microsoft_mcp/tools.py:415-419 (handler)The 'delete_email' tool handler. Deletes the email by sending a DELETE request to Microsoft Graph API endpoint /me/messages/{email_id}. The @mcp.tool decorator handles registration and schema inference from type annotations.
@mcp.tool def delete_email(email_id: str, account_id: str) -> dict[str, str]: """Delete an email""" graph.request("DELETE", f"/me/messages/{email_id}", account_id) return {"status": "deleted"}