block_sender
Create a persistent Gmail filter to block a sender in one account so future matching mail is automatically trashed, marked spam, or archived; existing messages stay untouched by default.
Instructions
Block a sender in ONE account by creating a persistent Gmail filter (the same mechanism as Gmail's native "Block" button): future mail matching from:<sender> is auto-trashed, marked spam, or archived. This is a settings change that keeps applying until it is removed, and future mail is silently dropped — say what you are about to block and why before calling it. By default NO existing mail is touched; set also_trash_existing=true only when the user asks for a cleanup as well. Reverse with unblock_sender.
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": {
"account": "<account>",
"sender": "<sender>"
},
"name": "block_sender"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | No | What to do with matching mail. "trash" (default) mirrors Gmail's Block button. | trash |
| sender | Yes | Email address (e.g. "spam@foo.com"), domain ("@foo.com"), or Gmail search fragment ("from:x subject:promo"). | |
| account | Yes | Account id ("personal", "tamu"). | |
| also_trash_existing | No | If true, ALSO retroactively trashes up to 100 existing messages from this sender. Defaults to false — blocking should not bulk-trash mail as a side effect. Trash is recoverable for 30 days. |