Authenticate and construct a searchanalytics.query POST request body
Add a 'dimensionFilterGroups' entry with 'dimension': 'query' and 'operator': 'includingRegex' or 'excludingRegex'
Provide a RE2-compatible regular expression string in the 'expression' field (Google uses the RE2 engine, not PCRE)
Test your regex against RE2 syntax before submitting — lookaheads and backreferences are not supported
Combine multiple filter groups using 'groupType': 'and' or 'or' to build compound segment queries
Verify the response rowCount against an unfiltered baseline to confirm the pattern is matching as expected
Known gotchas
RE2 does not support lookaheads, lookbehinds, or backreferences — patterns that work in Python re or JavaScript regex may silently fail or error
Regex filters apply after row aggregation, so a filter on 'query' still groups by whichever dimensions you requested
The 'includingRegex' and 'excludingRegex' operators were added in late 2021; older client libraries that hard-code allowed operator values may not include them
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp