Skip to main content

Gmail Cleanup Plan

Immutable Catalog Entry

This descriptor comes from the active versioned Portal catalog.

READgoogle.gmail_cleanup_plan
  • Contract tier: agent_ready
  • Risk: read
  • Catalog version: google-2026.07.12.2
  • Descriptor hash: 0a0a65049e96ee2116e6336f14af2720de0726474295115f581e5e4321d78f28

Use this read-only Gmail workflow tool to propose cleanup batches that must be approved before mutation. It reads the configured user's Google data through per-request OAuth, does not mutate provider state, and returns a normalized bounded envelope.

Request Body

{
"jsonrpc": "2.0",
"id": "google-gmail-cleanup-plan-example",
"method": "tools/call",
"params": {
"name": "google.gmail_cleanup_plan",
"arguments": {
"query": "query_example",
"top_n": 1,
"page_size": 1,
"max_messages": 1,
"proposed_action": "label",
"target_label_id": "target_label_id_123"
}
}
}

Arguments Schema

{
"type": "object",
"title": "gmail_cleanup_planArguments",
"properties": {
"query": {
"type": "string",
"title": "Query",
"default": "is:unread",
"description": "Provider query string used to filter results."
},
"top_n": {
"type": "integer",
"title": "Top N",
"default": 25,
"description": "Argument for gmail_cleanup_plan."
},
"page_size": {
"type": "integer",
"title": "Page Size",
"default": 100,
"description": "Maximum number of items to request from Google for this page."
},
"max_messages": {
"type": "integer",
"title": "Max Messages",
"default": 500,
"description": "Argument for gmail_cleanup_plan."
},
"proposed_action": {
"enum": [
"label",
"archive",
"mark_read",
"trash"
],
"type": "string",
"title": "Proposed Action",
"default": "label",
"description": "Argument for gmail_cleanup_plan."
},
"target_label_id": {
"type": "string",
"title": "Target Label Id",
"default": "",
"description": "Gmail label ID proposed for cleanup batches."
}
},
"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-cleanup-plan-example",
"method": "tools/call",
"params": {
"name": "google.gmail_cleanup_plan",
"arguments": {
"query": "query_example",
"top_n": 1,
"page_size": 1,
"max_messages": 1,
"proposed_action": "label",
"target_label_id": "target_label_id_123"
}
}
}'

Example Responses

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