cb-analytics-admin
Use this skill when the user wants to inspect or manage the Analytics service's runtime — checking ingestion health, killing runaway queries, restarting nodes,…
Use this skill when the user wants to write or improve SQL++ queries against Couchbase Analytics through cb-analytics-mcp. Trigger when they mention "SQL++", "Analytics query", "execute_query", "scan_consistency", "request_plus", "pagination", "EXPLAIN", "truncated", "row cap",
$ npx -y skills add celticht32/Couchbase-Skills-for-Claude.ai --skill cb-analytics-query --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/cb-analytics-queryContext preview
The summary Claude sees to decide when to auto-load this skill.
Use this skill when the user wants to write or improve SQL++ queries against Couchbase Analytics through cb-analytics-mcp. Trigger when they mention "SQL++", "Analytics query", "execute_query", "scan_consistency", "request_plus", "pagination", "EXPLAIN", "truncated", "row cap",
name: cb-analytics-query description: | Use this skill when the user wants to write or improve SQL++ queries against Couchbase Analytics through cb-analytics-mcp. Trigger when they mention "SQL++", "Analytics query", "execute_query", "scan_consistency", "request_plus", "pagination", "EXPLAIN", "truncated", "row cap", or anything about querying datasets, dataverses, joins, aggregations, windowing, query plans, or N1QL/SQL++ language features in this server's context. license: MIT
You have **five SQL++ tools** for talking to the Analytics service. Picking the right one matters — they have different cost profiles, rate-limit budgets, and result shapes.
| Tool | Cost | Result shape | When to reach for it | |---|---|---|---| | `execute_query` | high (full result) | rows, may be truncated | DDL, mutations, small SELECTs | | `execute_query_readonly` | high (full result), **cached** | rows, may be truncated, `cached: bool` | repeated SELECTs in an investigation loop | | `execute_query_paginated` | constant per page | first page + handle | SELECTs that might return many rows | | `fetch_next_page` | constant per page | next page for a handle | follow-up to paginated | | `explain_query` | tiny (no execution) | query plan | "why is this slow" |
If you only need the **first N rows** to answer the user's question, use `execute_query_paginated` with `page_size=N`. Don't pull a million rows through the MCP boundary just to take the first 20.
If you need to **show the user the data** (and the dataset is small), `execute_query_readonly` is fine — but watch for `truncated: true` in the response.
If you need to **make a decision** based on aggregates (`COUNT`, `SUM`, `AVG`, `GROUP BY`), the result is small by construction. Use `execute_query_readonly` and benefit from the cache.
Both `execute_query` and `execute_query_readonly` enforce a server-side row cap (default 1000, configurable via `MAX_QUERY_ROWS`). Responses include:
When you see `truncated: true`, **do not silently report incomplete data**. Either:
1. Tell the user the result is truncated and ask if they want all rows (then re-issue as paginated), or 2. If you only needed a sample, acknowledge it and continue ("here are the first 1000 of 47,832 matching rows").
The user is operating an LLM-driven tool. Hidden truncation will eventually produce wrong answers.
`execute_query_readonly` results are cached for ~60 seconds keyed by `(cluster, statement, scan_consistency)`. Responses include `cached: true` on a cache hit, `cached: false` on a miss. Practical implications:
into it.
`scan_consistency="request_plus"` so the cache key differs from the default-consistency cached entry.
wait 60s.
# 1. First page
first = execute_query_paginated(
statement="SELECT id, name, status FROM Default.Orders WHERE region = $r",
named_args={"r": "EMEA"},
page_size=100,
)
handle = first["data"]["pagination_handle"]
# Use first["data"]["results"] — that's your page 0
# 2. Walk pages until exhausted
while first["data"]["has_more"]:
nxt = fetch_next_page(pagination_handle=handle)
# Process nxt["data"]["results"]
if not nxt["data"]["has_more"]:
break
handle = nxt["data"]["pagination_handle"] # handle stays the same; this is for clarityImportant details:
the server adds its own.
`"not found or expired"`, just call `execute_query_paginated` again to start fresh.
Don't call `fetch_next_page` again with it.
plan = explain_query(statement="SELECT * FROM Default.Orders WHERE customer_id = 'C-1234'") # plan["data"]["plan"] is the service-internal JSON plan
When to reach for `explain_query`:
isn't already using one.
You don't have to add `EXPLAIN` to your statement; the tool prepends it if not present.
Never interpolate user-controlled values into the statement string. Use `named_args`:
execute_query(
statement="SELECT * FROM Default.Orders o WHERE o.customer_id = $cust",
named_args={"cust": "C-1234"},
)Identifiers (dataset names, field names) **can't** be parameterised by SQL++. If you must inject one, validate it first (the server already does this for `infer_schema`).
Note: `execute_query_paginated` also accepts `named_args` and `positional_args`. Parameter values are reused across pages — no need to re-pass them to `fetch_next_page`.
when correctness matters more than latency.
SDK code.
`scan_consistency` is part of the cache key for `execute_qu
Claude skill files for working with Couchbase — covering every major service and deployment pattern from application integration through AI applications, Kubernetes operations, mobile sync, security hardening, and analytics.
Repo: celticht32/Couchbase-Skills-for-Claude.ai
Use this skill when the user wants to inspect or manage the Analytics service's runtime — checking ingestion health, killing runaway queries, restarting nodes,…
Use this skill when the user wants to manage Couchbase Capella resources through the Cloud Management API — listing organisations and clusters, provisioning or…
Use this skill when the user wants to inspect or configure the Couchbase cluster itself — node membership, memory quotas, rebalance, auto-failover, system…
Use this skill when the user is managing Analytics data-source links — S3, Azure Blob, GCS, or remote Couchbase links — including creating, updating, listing,…
Use this skill when the user is setting up cb-analytics-mcp from scratch or troubleshooting an existing install — generating secrets, configuring .env, running…
Use this skill when the user wants to inspect, discover, or document the structure of Couchbase Analytics dataverses and datasets — listing what exists,…