MCP Tools Reference: gmailmcp.googleapis.com

工具:label_message

向经过身份验证的用户的 Gmail 账号中的特定邮件添加一个或多个标签。

如需查找消息 ID,请使用 search_threadsget_thread 等工具。如果不确定用户标签的 ID,请先使用 list_labels 工具发现可用的标签及其 ID。

以下示例演示了如何使用 curl 调用 label_message 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_message",
    "arguments": {
      // provide these details according to the tool MCP specification
    }
  },
  "jsonrpc": "2.0",
  "id": 1
}'
                

输入架构

LabelMessage RPC 的请求消息。

LabelMessageRequest

JSON 表示法
{
  "messageId": string,
  "labelIds": [
    string
  ]
}
字段
messageId

string

必需。要向其添加标签的消息的 ID。

labelIds[]

string

必需。要添加的标签的 ID。

输出架构

LabelMessage RPC 的响应消息。

工具注释

破坏性提示:❌ | 等幂性提示:✅ | 只读提示:❌ | 开放世界提示:❌