-
Multiple viz blocks may be returned. Scan their semantics to pick the most relevant ones. For example:
- Metrics and dimensions: Does the AQL contain the measures and breakdowns the user is asking about?
- Grain: Does the aggregation level match (e.g., daily vs. monthly, per-customer vs. per-region)?
- Filters: If date filters are visible in the AQL, check for obvious mismatches with the resolved date range.
-
Always inspect the AQL — don't rely on the viz block label and description alone.
-
If no viz blocks returned, proceed to generate AQL.
If validation passes: call tool
to show to result to user.
If validation fails: proceed to generate AQL (don't need to ask user for confirmation).