MCP Tools Reference: gmailmcp.googleapis.com

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 (  LabelColor 
 
) 
 } 
 } 
Fields
displayName

string

Required. The display name of the label to create.

Union field _color .

_color can be only one of the following:

color

object ( LabelColor )

Optional. The color of the label.

LabelColor

JSON representation
 { 
 "textColor" 
 : 
 string 
 , 
 "backgroundColor" 
 : 
 string 
 } 
Fields
textColor

string

The text color of the label, represented as a hex string (e.g., "#000000").

backgroundColor

string

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 (  LabelColor 
 
) 
 } 
 , 
 "threadsTotal" 
 : 
 integer 
 "threadsUnread" 
 : 
 integer 
 } 
Fields
labelId

string

The unique identifier of the label.

name

string

The human-readable display name of the label.

color

object ( LabelColor )

Optional. The color of the label.

Union field _threads_total .

_threads_total can be only one of the following:

threadsTotal

integer

The total number of threads under the label.

Union field _threads_unread .

_threads_unread can be only one of the following:

threadsUnread

integer

The number of unread threads under the label.

LabelColor

JSON representation
 { 
 "textColor" 
 : 
 string 
 , 
 "backgroundColor" 
 : 
 string 
 } 
Fields
textColor

string

The text color of the label, represented as a hex string (e.g., "#000000").

backgroundColor

string

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: ❌

Create a Mobile Website
View Site in Mobile | Classic
Share by: