malloy-phrase-detection
Search Target Construction for get_context
The get_context tool description defines each field and the two-phase workflow (source discovery, then per-source entity drill-down). This skill focuses on the parts you won't get right by default: classifying concepts into target types and splitting ambiguous phrases.
Tool names are written bare here -
get_context,execute_query,search_malloy_docs. The exact prefixed name depends on the host surface; match each against the tools you actually have.
Scope of this skill: the patterns below mostly apply to phase 2 (entity drill-down), building dimension / measure / view targets for a call scoped to a single source. Phase 1 (source discovery) is simpler: one or a few source targets describing the data domain, or a single source target with null search_text for listing. See the tool description for phase-1 guidance.
A note on matching: get_context searches over the model (sources, fields, views, and their descriptions), not the distinct categorical values stored in the data. To find which literal values a categorical dimension holds, target the dimension, then query its distinct values with execute_query (see the patterns below).
Authoring search_text for source targets (phase 1)
Aim for 3-8 words that name the entity and its business process. Don't include filter values, time ranges, or aggregations: those belong in phase-2 targets.
| Too vague | Over-specific (phase-2-ish) | Good |
|---|---|---|
"orders" |
"total order revenue by customer last year" |
"customer order history and line items" |
"customer data" |
"premium subscribers who churned in NYC" |
"subscriber accounts and churn" |
"metrics" |
"monthly revenue variance by account" |
"sales pipeline and revenue forecasts" |