UpdateThreadLabels

Add or remove a single label from every message in a Gmail thread. In Gmail, nearly all inbox operations are just label add/remove operations, so this tool is the primitive for archiving, marking read/unread, starring, trashing, marking important/spam, and applying or removing custom labels. Workflow: call ListLabels first to discover the UUID `id` for the label name you need, then call this tool with that `label_id` plus the thread's `thread_id` and `add=true` (apply) or `add=false` (remove). Each call modifies one label — to do multiple changes on the same thread (e.g. archive AND mark read), call this tool once per label. Common operations (look up each system label's id via ListLabels first): - Archive: remove `INBOX` (add=false) - Move back to inbox: add `INBOX` (add=true) - Mark as read: remove `UNREAD` (add=false) - Mark as unread: add `UNREAD` (add=true) - Star: add `STARRED` (add=true) / Unstar: remove (add=false) - Move to trash: add `TRASH` (add=true) / Restore: remove (add=false) - Mark important: add `IMPORTANT` (add=true) / Mark unimportant: remove (add=false) - Report spam: add `SPAM` (add=true) / Not spam: remove (add=false) - Apply custom user label: add the label with that display name (add=true) / Remove: (add=false) `thread_id` is the email thread UUID (the same id returned by ListEntities, search results, or GetThread). `label_id` is the UUID returned by ListLabels — NOT the label name.

UpdateThreadLabels

Add or remove a single label from every message in a Gmail thread. In Gmail, nearly all inbox operations are just label add/remove operations, so this tool is the primitive for archiving, marking read/unread, starring, trashing, marking important/spam, and applying or removing custom labels.

Workflow: call ListLabels first to discover the UUID id for the label name you need, then call this tool with that label_id plus the thread's thread_id and add=true (apply) or add=false (remove). Each call modifies one label — to do multiple changes on the same thread (e.g. archive AND mark read), call this tool once per label.

Common operations (look up each system label's id via ListLabels first):

  • Archive: remove INBOX (add=false)
  • Move back to inbox: add INBOX (add=true)
  • Mark as read: remove UNREAD (add=false)
  • Mark as unread: add UNREAD (add=true)
  • Star: add STARRED (add=true) / Unstar: remove (add=false)
  • Move to trash: add TRASH (add=true) / Restore: remove (add=false)
  • Mark important: add IMPORTANT (add=true) / Mark unimportant: remove (add=false)
  • Report spam: add SPAM (add=true) / Not spam: remove (add=false)
  • Apply custom user label: add the label with that display name (add=true) / Remove: (add=false)

thread_id is the email thread UUID (the same id returned by ListEntities, search results, or GetThread). label_id is the UUID returned by ListLabels — NOT the label name.

Parameters

Parameter Type Required Description
thread_id string Yes The ID of the email thread to modify. Same UUID returned by ListEntities, search, or GetThread.
label_id string Yes The UUID of the label to add or remove. Obtain this by calling ListLabels and looking up the label by name — do not pass the label name here.
add boolean Yes Whether to add (true) or remove (false) the label from every message in the thread.