[BUG] WebSearch Tool Fails with "input_schema: Field required" Error
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Environment
Claude Code Version: 2.1.50
Installation Method: npm (@anthropic-ai/claude-code)
Platform: macOS Darwin 25.3.0
Node Version: v24.3.0
Shell: zsh
Description
The WebSearch tool consistently fails with a 400 error when invoked. The API returns an error indicating that the custom tool definition is missing the required input_schema field.
What Should Happen?
WebSearch tool should construct a valid custom tool definition with the input_schema field properly populated, then successfully execute web searches.
Error Messages/Logs
**Error Message**
[ERROR] API error (attempt 1/11): 400 400 tools.0.custom.input_schema: Field required
[ERROR] Error in API request: 400 tools.0.custom.input_schema: Field required
2026-02-22T15:06:24.368Z [DEBUG] executePreToolHooks called for tool: WebSearch
2026-02-22T15:06:24.401Z [DEBUG] attribution header x-anthropic-billing-header: cc_version=2.1.50.bf3
2026-02-22T15:06:25.026Z [ERROR] API error (attempt 1/11): 400 400 tools.0.custom.input_schema: Field required
2026-02-22T15:06:25.030Z [ERROR] Error in API request: 400 tools.0.custom.input_schema: Field required
2026-02-22T15:06:25.033Z [DEBUG] Getting matching hook commands for PostToolUse with query: WebSearch
The error occurs consistently across multiple attempts:
Line 205: First occurrence
Line 249: Second occurrence
Both result in the same tools.0.custom.input_schema: Field required error
Steps to Reproduce
Steps to Reproduce
Install Claude Code version 2.1.50
Start a session with claude
Request Claude to perform a web search (e.g., "search the web for X")
Grant WebSearch permission when prompted
Observe the error in debug logs
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.50
Platform
Other
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗