# collection

Query

Return a single Collection by ID for the current workspace, or null if no such Collection exists here.

Available to agents as MCP tool `getCollection` — see [Read tools](/api/v2/docs/mcp/read-tools#get-collection).

## Arguments

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `id` | `ID!` | Yes | — | ID of the Collection to fetch, as returned by the `collections` query for this workspace. |

## Returns

Returns [`Collection`](/api/v2/docs/types/collection).

## Examples

### Get a collection by ID

Fetch a single Collection by its ID.

```graphql
query CollectionDefault($id: ID!) {
  collection(id: $id) {
    id
    name
    itemCount
    createdAt
    updatedAt
  }
}
```

Variables:

```json
{
  "id": "122321ce-843e-5b07-9f56-94323c0ae39e"
}
```

Response — HTTP 200:

```json
{
  "data": {
    "collection": {
      "id": "122321ce-843e-5b07-9f56-94323c0ae39e",
      "name": "Best Sellers",
      "itemCount": 3,
      "createdAt": "2024-12-31T21:00:00Z",
      "updatedAt": "2024-12-31T21:00:00Z"
    }
  }
}
```
