## Tool: `create_label`

> [!WARNING]
> **Developer Preview:** Available as part of the [Google Workspace Developer Preview Program](https://developers.google.com/workspace/preview), which grants early access to certain features.

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 |
|---|
| ```bash 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 (`https://developers.google.com/workspace/gmail/api/reference/mcp/tools_list/list_labels#Output.Schema.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 (`https://developers.google.com/workspace/gmail/api/reference/mcp/tools_list/list_labels#Output.Schema.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 (`https://developers.google.com/workspace/gmail/api/reference/mcp/tools_list/list_labels#Output.Schema.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 (`https://developers.google.com/workspace/gmail/api/reference/mcp/tools_list/list_labels#Output.Schema.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: ❌