WebSearch tool returns 400 invalid request parameters on all queries
Summary
WebSearch tool consistently returns API Error: 400 invalid request parameters: invalid request for valid queries. Reproduced just now across three different multi-word queries in a single session.
Repro
In Claude Code session (Opus 4.7), invoke WebSearch with any reasonable query, e.g.:
agentic second brain LLM memory system best practices 2026 hierarchical retrievalClaude Code hooks memory file based agent context engineering patternsPARA method Zettelkasten LLM agent retrieval team knowledge base
All three returned identically:
API Error: 400 invalid request parameters: invalid request
No domain filters, no allowed_domains / blocked_domains, just the query field.
Expected
Search results, or at minimum a more actionable error (rate-limit, auth, query-too-long, region-restricted, etc).
Environment
- macOS (Darwin 25.5.0)
- Claude Code, model
claude-opus-4-7 - Date: 2026-05-26
- Reproduced in 3/3 attempts in same session
Notes
The tool prompt mentions web search is US-only — if that's the cause, the error message should say so rather than returning a generic 400. From the user's perspective WebSearch just looks broken.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗