Gmail
Gmail_ChangeEmailLabels
Add or remove one user-created label on at most 50 messages per call. A message already in the requested state is a noop, but the tool is not idempotent in query mode: repeated calls with the same query advance to the next chunk, so a blind retry can label further messages. This lane does not accept Gmail system labels or triage state changes. Selector and label validation finish before mutation. Query selectors may match more than 50 messages; each call processes up to 50 remaining actionable matches. A query with zero matches returns requested=0, items=[], complete=true, and all_matches_processed=true (vacuous completion).
Remote gmail
Remote (network-hosted)
Other tools also called Gmail_ChangeEmailLabels?
See providers with this name
Input Schema
{
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "A scoped Gmail search query. Defaults to no query. Provide exactly one selector: email_ids or query. Common operators/formats: from:, to:, subject:, label:, in:/is:, has:attachment, category:, filename:, before:/after: YYYY/MM/DD, older_than:/newer_than: with d/m/y suffixes, quoted phrases, implicit AND, OR, parentheses grouping, and -/NOT negation. before:/after: date literals are interpreted as midnight PST, not the user's local time; when local calendar-day boundaries matter, pass Unix-second timestamps to before:/after: instead. The query must include at least one positive narrowing term; catch-all is:anywhere / in:anywhere and negative-only expressions are rejected. One call processes at most 50 remaining actionable matches after desired-state filtering; all_matches_processed and the optional approximate matched_estimate describe that actionable selection. In query mode, Spam and Trash are excluded from selection unless the query itself includes in:spam or in:trash — so a label may still remain on trashed/spam copies after a REMOVE. ADD excludes messages that already have the label and REMOVE keeps only messages that still have it, so repeated calls progress. Gmail cannot safely render label names containing quotes or backslashes in a query; use explicit email_ids for those labels."
},
"action": {
"enum": [
"add",
"remove"
],
"type": "string",
"description": "Whether to add or remove the one user-created label."
},
"email_ids": {
"type": "array",
"items": {
"type": "string"
},
"description": "Explicit Gmail message IDs to act on (1-50). Defaults to no explicit IDs. Provide exactly one selector: email_ids or query. Duplicate IDs are removed (first occurrence kept), then the 50-ID cap is applied; blank or malformed IDs fail before any mutation."
},
"label_name": {
"type": "string",
"description": "Exactly one existing user-created Gmail label name; system labels are rejected."
},
"include_full_ledger": {
"type": "boolean",
"description": "When true, items includes every processed message (changed/noop and problems). When false (default), items lists only non-success rows so the response stays count-first. Use counts.changed / counts.noop for success volume."
}
}
}