modify_labels
Add or remove labels on one or many Gmail threads in a single call. Unknown labels in add are created automatically; archive or mark read by removing INBOX or UNREAD.
Instructions
Add/remove labels on a thread. Archive = remove 'INBOX'; mark read = remove 'UNREAD'. Labels may be given by name or by id: an unknown name in add is created automatically (use '/' for nested labels), an unknown name in remove is ignored. USE WHEN: applying custom labels or label combinations in one call. DO NOT USE: for plain archive/read/unread — the dedicated tools are clearer. Pass threadIds (a list of up to 100) instead of threadId to apply the same change to every listed thread in one call — for 'exactly these threads, as approved'. The answer then reports per thread: changed, failed (with code and message; the others still ran) and notAttempted (the run stopped at a rate limit, dead token or missing scope, which would have hit every remaining thread alike); ok is true only when all were changed. SIDE EFFECTS: changes the thread's labels (and may create a label named in add, once per call even for a list); reversible by the inverse call.
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": "modify_labels"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| add | No | ||
| remove | No | ||
| threadId | No | ||
| threadIds | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| failed | No | ||
| changed | No | ||
| notAttempted | No |