# operation

Query

Return details for an operation by ID, including status and progress.

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

## Arguments

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `id` | `ID!` | Yes | — | Unique identifier for the operation. |

## Returns

Returns [`Operation`](/api/v2/docs/types/operation).

## Examples

### Get an operation by ID

Fetch a background operation's status and progress by ID.

```graphql
query OperationDefault($id: ID!) {
  operation(id: $id) {
    id
    status
    operationType
    total
    processed
    succeededCount
    failedCount
    pendingCount
    createdAt
    completedAt
  }
}
```

Variables:

```json
{
  "id": "aeb032f4-179f-549f-b83c-3db2c5b58a2d"
}
```

Response — HTTP 200:

```json
{
  "data": {
    "operation": {
      "id": "aeb032f4-179f-549f-b83c-3db2c5b58a2d",
      "status": "COMPLETED",
      "operationType": "refetch_engagement",
      "total": 1,
      "processed": 1,
      "succeededCount": 1,
      "failedCount": 0,
      "pendingCount": 0,
      "createdAt": "2024-12-31T22:00:00Z",
      "completedAt": null
    }
  }
}
```
