Tool: create_label
Creates a new label in the authenticated user's Gmail account.
The following sample demonstrate how to use curl to invoke the create_label MCP tool.
| Curl Request |
|---|
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 }' |
Input Schema
Request message for CreateLabel RPC.
CreateLabelRequest
| JSON representation |
|---|
{
"displayName": string,
"color": {
object ( |
| Fields | |
|---|---|
displayName |
Required. The display name of the label to create. |
Union field
|
|
color |
Optional. The color of the label. |
LabelColor
| JSON representation |
|---|
{ "textColor": string, "backgroundColor": string } |
| Fields | |
|---|---|
textColor |
The text color of the label, represented as a hex string (e.g., "#000000"). |
backgroundColor |
The background color of the label, represented as a hex string (e.g., "#ffffff"). |
Output Schema
Details of a label.
Label
| JSON representation |
|---|
{
"labelId": string,
"name": string,
"color": {
object ( |
| Fields | |
|---|---|
labelId |
The unique identifier of the label. |
name |
The human-readable display name of the label. |
color |
Optional. The color of the label. |
Union field
|
|
threadsTotal |
The total number of threads under the label. |
Union field
|
|
threadsUnread |
The number of unread threads under the label. |
LabelColor
| JSON representation |
|---|
{ "textColor": string, "backgroundColor": string } |
| Fields | |
|---|---|
textColor |
The text color of the label, represented as a hex string (e.g., "#000000"). |
backgroundColor |
The background color of the label, represented as a hex string (e.g., "#ffffff"). |
Tool Annotations
Destructive Hint: ❌ | Idempotent Hint: ❌ | Read Only Hint: ❌ | Open World Hint: ❌