# createCollection

Mutation

Create a Collection (saved tag set) in the current workspace.

Available to agents as MCP tool `createCollection` — see [Write tools](/api/v2/docs/mcp/write-tools#create-collection).

## Arguments

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `input` | [`CreateCollectionInput!`](/api/v2/docs/types/create-collection-input) | Yes | — | Mutation input. |

## Returns

| Name | Type | Description |
| --- | --- | --- |
| `collection` | [`Collection`](/api/v2/docs/types/collection) | The newly created Collection. Null on validation failure. |
| `userErrors` | [`[UserError!]!`](/api/v2/docs/types/user-error) | List of user-facing validation errors. Empty on success. |

## Examples

### Create a collection

Create a saved Collection (tag set) in the workspace.

```graphql
mutation CreateCollectionDefault($input: CreateCollectionInput!) {
  createCollection(input: $input) {
    collection {
      id
      name
      itemCount
    }
    userErrors {
      field
      message
    }
  }
}
```

Variables:

```json
{
  "input": {
    "name": "Holiday Favorites"
  }
}
```

Response — HTTP 200:

```json
{
  "data": {
    "createCollection": {
      "collection": {
        "id": "17ccdf4e-19d2-5b30-9787-d4f0886ddf29",
        "name": "Holiday Favorites",
        "itemCount": 0
      },
      "userErrors": []
    }
  }
}
```
