Gmail Modify Messages
gmail_modify_messagesChange Gmail message or thread state in one call: add or remove labels, mark read or unread, archive or restore to inbox, report spam, or recover from Trash.
Instructions
Change the state of Gmail messages or of one whole conversation: add or remove labels by name or ID, mark read or unread, archive or move back to the inbox, report spam or not spam, or restore from Trash, in one call. Use gmail_delete to move mail to Trash or delete it, and gmail_manage_labels to create or rename labels. Returns status 'ok', the label IDs added and removed, untrashed, processed and messages (id, thread_id, label_ids) when Gmail reports them (one message or a thread). Changing 10 or more message_ids asks the user to confirm first.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "gmail_modify_messages"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| spam | No | True reports the mail as spam (adds SPAM, removes INBOX); false takes it out of Spam (removes SPAM and adds INBOX, unless archive is true). | |
| archive | No | True archives the mail (removes INBOX; it stays in All Mail), false moves it back to the inbox (adds INBOX). | |
| dry_run | No | True previews the call instead of running it: nothing is sent to Google and the user is not asked. Returns status 'dry_run', preview, action, count (distinct message IDs; null for a thread_id), requested_count (IDs as given) and consent_required: whether the real call would ask the user to confirm. | |
| untrash | No | True first restores the mail from Trash, undoing gmail_delete with mode 'trash'; permanently deleted mail cannot be restored. | |
| mark_read | No | True marks the mail read (removes UNREAD), false marks it unread (adds UNREAD). | |
| thread_id | No | Gmail thread ID (thread_id from search or read results): the change applies to every message of that conversation; give message_ids or thread_id, not both. | |
| add_labels | No | Labels to add. Label names as shown in Gmail (e.g. 'Clients/Acme') or label IDs; system labels such as STARRED, IMPORTANT or INBOX are matched case-insensitively. An unknown or ambiguous name fails with not_found and the candidate labels; no label is created. | |
| message_ids | No | Gmail message IDs to change, 1 to 1,000, from gmail_search_emails, gmail_get_mail_digest or gmail_read_emails; give message_ids or thread_id, not both. | |
| remove_labels | No | Labels to remove. Label names as shown in Gmail (e.g. 'Clients/Acme') or label IDs; system labels such as STARRED, IMPORTANT or INBOX are matched case-insensitively. An unknown or ambiguous name fails with not_found and the candidate labels; no label is created. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| status | No | Machine-readable operation status. | |
| messages | No | ||
| processed | No | ||
| thread_id | No | ||
| untrashed | No | ||
| message_ids | No | ||
| added_label_ids | No | ||
| removed_label_ids | No |