工具:label_thread
向经过身份验证的用户的 Gmail 账号中的整个对话串添加标签。此操作会影响消息串中的所有现有消息以及将来添加到其中的任何消息。
如果不确定线程 ID,请先使用 search_threads 工具。
如果不确定用户标签的 ID,请先使用 list_labels 工具发现可用的标签及其 ID。
以下示例演示了如何使用 curl 调用 label_thread MCP 工具。
| Curl 请求 |
|---|
curl --location 'https://gmailmcp.googleapis.com/mcp' \ --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 MCP specification } }, "jsonrpc": "2.0", "id": 1 }' |
输入架构
针对 LabelThread RPC 的请求消息。
LabelThreadRequest
| JSON 表示法 |
|---|
{ "threadId": string, "labelIds": [ string ] } |
| 字段 | |
|---|---|
threadId |
必需。要添加标签的线程的唯一标识符。 |
labelIds[] |
必需。要添加的标签的唯一标识符。可以是系统标签 ID(例如“INBOX”“TRASH”“SPAM”“STARRED”“UNREAD”),也可以是用户定义的标签 ID。 |
输出架构
针对 LabelThread RPC 的响应消息。
工具注释
破坏性提示:❌ | 等幂性提示:✅ | 只读提示:❌ | 开放世界提示:❌