Skip to main content

Gmail Apply Cleanup Plan

Immutable Catalog Entry

This descriptor comes from the active versioned Portal catalog.

DESTRUCTIVEgoogle.gmail_apply_cleanup_plan
  • Contract tier: agent_ready
  • Risk: destructive
  • Catalog version: google-2026.07.12.2
  • Descriptor hash: c5fe15cc6b08e2fed3261f3034941e853dd28ea3ea103b256684d4977b33e714

Use this destructive Gmail workflow tool only after approving an explicit cleanup batch; dry_run defaults to true. It can overwrite, send, move, remove, or permanently delete Google data. Use it only after preview and the manifest-defined confirmation; it requires per-request Google OAuth.

Request Body

{
"jsonrpc": "2.0",
"id": "google-gmail-apply-cleanup-plan-example",
"method": "tools/call",
"params": {
"name": "google.gmail_apply_cleanup_plan",
"arguments": {
"message_ids": [],
"action": "label",
"confirm": false,
"dry_run": false,
"label_id": "label_id_123"
}
}
}

Arguments Schema

{
"type": "object",
"title": "gmail_apply_cleanup_planArguments",
"required": [
"message_ids",
"action"
],
"properties": {
"action": {
"enum": [
"label",
"archive",
"mark_read",
"trash"
],
"type": "string",
"title": "Action",
"description": "Cleanup or mutation action to perform after approval."
},
"confirm": {
"type": "boolean",
"title": "Confirm",
"default": false,
"description": "Required true for high-risk operations when confirmation is enforced."
},
"dry_run": {
"type": "boolean",
"title": "Dry Run",
"default": true,
"description": "When true, return the planned operation without mutating provider data."
},
"label_id": {
"type": "string",
"title": "Label Id",
"default": "",
"description": "Gmail label ID."
},
"message_ids": {
"type": "array",
"items": {
"type": "string"
},
"title": "Message Ids",
"description": "List of Gmail message IDs."
}
},
"additionalProperties": false
}

Output Schema

{
"type": "object",
"required": [
"ok",
"data",
"error",
"meta"
],
"properties": {
"ok": {
"type": "boolean",
"description": "Whether the local or Google provider operation completed successfully."
},
"data": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "array",
"items": {}
},
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "null"
}
],
"description": "Bounded local navigation or Google provider result when ok is true."
},
"meta": {
"type": "object",
"description": "Safe timing, pagination, cache, request, and truncation metadata.",
"additionalProperties": true
},
"error": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"description": "Safe structured error when ok is false."
}
},
"description": "Google MCP normalized operation envelope.",
"additionalProperties": false
}

Code Examples

curl -X POST 'https://portal.madpanda3d.com/api/mcp' \
-H 'Authorization: Bearer mad_live_***' \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": "google-gmail-apply-cleanup-plan-example",
"method": "tools/call",
"params": {
"name": "google.gmail_apply_cleanup_plan",
"arguments": {
"message_ids": [],
"action": "label",
"confirm": false,
"dry_run": false,
"label_id": "label_id_123"
}
}
}'

Example Responses

{
"ok": true,
"message": "Tool google.gmail_apply_cleanup_plan executed successfully.",
"note": "Response shape varies by MCP tool. Inspect live responses for exact fields."
}