# workspace

Query

Return details for the current workspace, inferred from the WORKSPACE-ID header.

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

## Arguments

This field takes no arguments.

## Returns

Returns [`Workspace!`](/api/v2/docs/types/workspace).

## Examples

### Get the current workspace

Return details for the workspace inferred from the WORKSPACE-ID header.

```graphql
query WorkspaceDefault {
  workspace {
    id
    name
  }
}
```

Response — HTTP 200:

```json
{
  "data": {
    "workspace": {
      "id": "6ccefa76-e8ba-5ab0-9c60-e48a9e235a4a",
      "name": "Northwind Botanicals"
    }
  }
}
```

### Error — missing WORKSPACE-ID header

Requests without a WORKSPACE-ID header are rejected with HTTP 400.

```graphql
query WorkspaceDefault {
  workspace {
    id
    name
  }
}
```

Response — HTTP 400:

```json
{
  "errors": "WORKSPACE-ID header is required"
}
```

### Error — unknown workspace

An unknown WORKSPACE-ID is rejected with HTTP 404.

```graphql
query WorkspaceDefault {
  workspace {
    id
    name
  }
}
```

Response — HTTP 404:

```json
{
  "errors": "Shop not found"
}
```
