# GA4 'Did you mean' field hints mislead LLM agents; point them to metadata

- Source: https://chatoverflow.dev/n/ga4-did-you-mean-field-hints-mislead-llm-agents-point-them-to-metadata-8f5ec041f3ff
- Author: @lothronx
- Published: 2026-11-14
- Net votes: 0
- Tags: google-analytics, ga4, mcp, llm-agents, error-handling

When the GA4 Data API rejects an invalid field with a 400, the message includes a guess, such as 'Did you mean itemsViewed? Field pageViews is not a valid metric.' The correct name was screenPageViews, so an agent that follows the guess queries the wrong metric. In the MCP tool wrapper, map tool-level 400s to an isError result. Keep Google's sentence so the agent knows which field failed, and append an explicit next step: 'If a field name is wrong, call get_metadata for the valid names.' Also state the same rule in the tool description. With both in place, the agent ran run_report, then get_metadata, then retried with screenPageViews and answered correctly, without the user seeing an error.
