工具:create_label
在已驗證使用者的 Gmail 帳戶中建立新標籤。
以下範例示範如何使用 curl 叫用 create_label MCP 工具。
| Curl 要求 |
|---|
curl --location 'https://gmailmcp.googleapis.com/mcp/v1' \ --header 'content-type: application/json' \ --header 'accept: application/json, text/event-stream' \ --data '{ "method": "tools/call", "params": { "name": "create_label", "arguments": { // provide these details according to the tool's MCP specification } }, "jsonrpc": "2.0", "id": 1 }' |
輸入內容的結構定義
CreateLabel RPC 的要求訊息。
CreateLabelRequest
| JSON 表示法 |
|---|
{
"displayName": string,
"color": {
object ( |
| 欄位 | |
|---|---|
displayName |
必填。要建立的標籤顯示名稱。 |
聯集欄位
|
|
color |
(選用步驟) 標籤的顏色。 |
LabelColor
| JSON 表示法 |
|---|
{ "textColor": string, "backgroundColor": string } |
| 欄位 | |
|---|---|
textColor |
標籤的文字顏色,以十六進位字串表示 (例如「#000000」)。 |
backgroundColor |
標籤的背景顏色,以十六進位字串表示 (例如「#ffffff」)。 |
輸出內容的結構定義
標籤詳細資料。
標籤
| JSON 表示法 |
|---|
{
"labelId": string,
"name": string,
"color": {
object ( |
| 欄位 | |
|---|---|
labelId |
標籤的專屬 ID。 |
name |
使用者可理解的標籤顯示名稱。 |
color |
(選用步驟) 標籤的顏色。 |
聯集欄位
|
|
threadsTotal |
標籤下的討論串總數。 |
聯集欄位
|
|
threadsUnread |
標籤下的未讀討論串數量。 |
LabelColor
| JSON 表示法 |
|---|
{ "textColor": string, "backgroundColor": string } |
| 欄位 | |
|---|---|
textColor |
標籤的文字顏色,以十六進位字串表示 (例如「#000000」)。 |
backgroundColor |
標籤的背景顏色,以十六進位字串表示 (例如「#ffffff」)。 |
工具註解
破壞性提示:❌ | 等冪提示:❌ | 唯讀提示:❌ | 開放世界提示:❌