Tool: label_thread
Adds labels to an entire thread in the authenticated user's Gmail account. This operation affects all messages currently in the thread and any future messages added to it.
If unsure of the thread ID, use the search_threads tool first.
If unsure of a user label's ID, use the list_labels tool first to discover available labels and their IDs. To add a trash label or a spam label on to a thread, please use the apply_sensitive_thread_label tool instead.
The following sample demonstrate how to use curl to invoke the label_thread MCP tool.
| Curl Request |
|---|
curl --location 'https://gmailmcp.googleapis.com/mcp/v1' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'content-type: application/json' \ --header 'accept: application/json, text/event-stream' \ --data '{ "method": "tools/call", "params": { "name": "label_thread", "arguments": { // provide these details according to the tool's MCP specification } }, "jsonrpc": "2.0", "id": 1 }' |
Input Schema
Request message for LabelThread RPC.
LabelThreadRequest
| JSON representation |
|---|
{ "threadId": string, "labelIds": [ string ] } |
| Fields | |
|---|---|
threadId |
Required. The unique identifier of the thread to add labels to. |
labelIds[] |
Required. The unique identifiers of the labels to add. Can be a system label ID (e.g., 'INBOX', 'STARRED', 'UNREAD', 'IMPORTANT') or a user-defined label ID. The tool accepts |
Output Schema
Response message for LabelThread RPC.
Tool Annotations
Destructive Hint: ❌ | Idempotent Hint: ✅ | Read Only Hint: ❌ | Open World Hint: ❌
Authorization Scopes
Requires one of the following OAuth scopes:
https://mail.google.com/https://www.googleapis.com/auth/gmail.modify