get_cluster_tasks
Retrieve current Couchbase cluster tasks (rebalance, compaction, XDCR, index builds) to find stuck jobs and lagging replication. Pair with metrics to tell slow progress from flatlined tasks.
Instructions
Get the cluster tasks running right now — rebalance, compaction, XDCR, index build.
Answers "what is this cluster doing?" — where stuck rebalances, hung index builds and lagging XDCR surface. One call is a single sample, so pair it with get_cluster_metrics to tell "slow but progressing" from "flatlined".
Calls GET /pools/default/tasks. Self-managed Couchbase Server 7.6+ only (Capella is rejected without a REST call); needs the Read-Only Admin (ro_admin) role.
Returns the endpoint's array unchanged, or [] if no tasks are reported. Only "type" and "status" are common to every entry; the rest are per type — rebalance: progress, perNode, detailedProgress, stageInfo, subtype; bucket_compaction: bucket, progress, changesDone, totalChanges; xdcr: changesLeft, docsChecked, docsWritten, source, target; global_indexes/indexer: bucket, index, progress, id; loadingSampleBucket: task_id, bucket, bucket_uuid.
Reading the result:
An idle cluster still reports a rebalance entry with status "notRunning", so check each task's "status" rather than counting entries.
"statusIsStale": true means the cluster cannot vouch for that status — read it as "unknown", not "stuck". Flatlined progress and a status that stopped updating look identical here but mean different things.
"progress" means different things per type, so do not compare it across tasks.
Poll no faster than "recommendedRefreshPeriod" (seconds), the server's own hint.
"cancelURI"/"lastReportURI" are informational UI links; this tool only ever GETs and never invokes them.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| timeout | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |