WebSearch tool always errors: 'Cannot specify both allowed_domains and blocked_domains'
Resolved 💬 2 comments Opened Jan 19, 2026 by szj2ys Closed Feb 27, 2026
Summary\nThe built-in WebSearch tool appears unusable in this environment. Every invocation fails with:\n\n> Error: Cannot specify both allowed_domains and blocked_domains in the same request\n\nThis happens even when I only set one of the two fields (or attempt to leave them empty).\n\n## Environment\n- Claude Code: 2.1.12\n- OS: macOS (Darwin 25.2.0, arm64)\n- GitHub CLI: 2.72.0\n\n## Repro steps\n1. Invoke WebSearch with a simple query.\n2. Example payload:\n\n\n\n## Actual\nTool returns:\n\n``\nError: Cannot specify both allowed_domains and blocked_domains in the same request\n``\n\n## Expected\nA normal web search result set, or at least an error indicating WebSearch is unavailable (e.g., region restriction), but not a parameter-validation error when only one option is intended.\n\n## Notes\nIt looks like the gateway/tool layer may be treating both parameters as "specified" even when empty, or the client is always sending both fields.\n
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗