claude-code - 💡(How to fix) Fix WebSearch tool returns 400 invalid request parameters on all queries

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

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.

Error Message

API Error: 400 invalid request parameters: invalid request

Root Cause

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.

Code Example

API Error: 400 invalid request parameters: invalid request
RAW_BUFFERClick to expand / collapse

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 retrieval
  • Claude Code hooks memory file based agent context engineering patterns
  • PARA 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.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING