Write, validate, and (optionally) execute an NQL query against a Narrative dataset. Drafts the query from the user's question, runs validation until it compiles, explains the query in plain English, and only runs it on explicit approval.
| Argument | Required / Default | Description |
|---|---|---|
--run | Optional | Skip the end-of-flow confirmation and execute the query immediately after validation succeeds. |
--dataset <id> | Optional | Pre-bind the target dataset. Skips the dataset-search step. |
--limit <n> | Optional | Override the default LIMIT (default 100 for raw selects, no limit for aggregations). |
--no-explain | Optional | Skip the plain-English explanation. Use only when the caller is another skill or automation. |
<free-text tail> | Optional | Treated as the user's question (e.g., /write-nql --dataset 12345 how many distinct users last 30 days). With no arguments, the skill walks the user through the flow interactively. |
| Prompt | When to use it |
|---|---|
Count distinct sha256_hashed_email values in dataset 123 | Quickly size the addressable email reach of a dataset. |
Validate this NQL before I run it | Catch parser errors (COUNT(*), != , reserved words) before submitting a job. |
Show the top 100 rows where graph_edge.is_directed is false | Inspect symmetric same-entity edges in a graph source. |
/write-nql --dataset 123 --run --limit 50 distinct users in the last 30 days | Bind a dataset, cap results at 50, and execute immediately once validation passes. |
This skill calls tools from the MCP servers listed below — connect them so your agent has the tools the skill needs.