name: validate-gaql description: Performs a dry-run validation of a GAQL query using the Google Ads API validate_only parameter.
Validate GAQL
This skill validates a GAQL query by performing a dry-run execution against the Google Ads API.
Usage
- Schema Discovery: Use
GoogleAdsFieldService.search_google_ads_fieldsto verify field existence, selectability, and filterability. - Compatibility Check: Query the primary resource's
selectable_withattribute. Verify all selected fields are compatible. - Static Analysis:
WHEREfields MUST be inSELECT(unless core date segments).ORis forbidden. UseINor multiple queries.- No
FROMclause in metadata queries. - Metadata Field Names: When using
GoogleAdsFieldService.search_google_ads_fields, field names MUST NOT be prefixed with the resource name (e.g., usename, notgoogle_ads_field.name). Do NOT useGoogleAdsServiceto querygoogle_ads_field. Failure results inUNRECOGNIZED_FIELD.
- Runtime Dry Run: Execute the following command:
./.venv/bin/python3 .agents/skills/validate_gaql/scripts/validate_gaql.py --customer_id <customer_id> --api_version <api_version> << 'EOF'
SELECT campaign.id, campaign.name FROM campaign
EOF
- Success: Proceed to implementation.
- Failure: Fix query based on validator output and restart from Step 1.