Create Inbox Rule
create_mail_ruleCreate inbox rules that move, copy, mark read, set importance, categorize, or delete new mail when conditions match; at least one condition and one action are required, and mail is never forwarded.
Instructions
Create an inbox rule that acts on new incoming mail: move or copy it to a folder, mark it read, set its importance, add categories, or delete it. Needs at least one condition and one action; several conditions must all match. Rules here never forward or redirect mail.
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": {
"name": "<name>"
},
"name": "create_mail_rule"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Rule name | |
| delete | No | Move matches to Deleted Items | |
| enabled | No | Create the rule turned on (default) or off | |
| mailbox | No | Email address of another mailbox to act on (delegated or shared), e.g. 'someone@example.com'. Omit for your own mailbox; required when this server signs in as an application. Only addresses this server is configured to allow will be accepted. | |
| sequence | No | Position among the rules; lower runs first (default 1) | |
| importance | No | Only messages of this importance | |
| mark_as_read | No | Mark matches as read | |
| body_contains | No | Text in the body, any of which matches | |
| copy_to_folder | No | Folder to copy matches to, named the same ways | |
| from_addresses | No | Sender email addresses, any of which matches | |
| move_to_folder | No | Folder to move matches to: a well-known name (archive, junkemail), display name, or ID | |
| has_attachments | No | true: only messages with attachments. false is ignored | |
| mark_importance | No | Set matches' importance | |
| sender_contains | No | Text in the sender's name or address | |
| sent_only_to_me | No | true: only messages where you are the only recipient. false is ignored | |
| subject_contains | No | Text in the subject, any of which matches | |
| assign_categories | No | Categories to add to matches | |
| recipient_contains | No | Text in the To or CC recipients | |
| stop_processing_rules | No | Skip later rules for a message this rule matched | |
| body_or_subject_contains | No | Text in the body or subject |