plan_modify
Preview which emails a Gmail query will affect, return a plan ID for execute_plan, and show a summary for approval before applying archive, trash, read, star, spam, or label changes.
Instructions
Dry run: changes nothing. Returns what would be affected and a plan_id for execute_plan. Show the user the summary before asking whether to execute. Archive, trash or untrash, mark read or unread, star or unstar, mark important or not, report spam or not spam, or add/remove a label on the messages a query matches (untrash needs in:trash in the query, not_spam needs in:spam). The count is exact; top senders and sample subjects come from the newest 200. Trash holds at most 5000 per plan.
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": {
"mailbox": "<mailbox>",
"query": "<query>",
"action": "<action>"
},
"name": "plan_modify"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| max | No | Messages to include, default 1000, at most 200000 | |
| label | No | Label name, for add_label and remove_label | |
| query | Yes | Gmail search syntax, e.g. "category:promotions older_than:30d" | |
| action | Yes | ||
| mailbox | Yes | A connected mailbox address (see list_mailboxes) |