[BUG] WebSearch tool missing input_schema - API Error 422

Status Closed — not planned
Maintainer reply None cached
Activity 12 comments · opened Oct 7, 2025 · closed Jan 26, 2026

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?

The WebSearch tool is returning a 422 error indicating a missing input_schema field.

What Should Happen?

the websearch tool can work.

Error Messages/Logs

API Error: 422 {"detail":[{"type":"missing","loc":["body","tools",0,"input_schema"],"msg":"Field required","input":{"type":"web_search_20250305","name":"web_search","max_uses":8}}]}

Steps to Reproduce

  1. Use the WebSearch tool with any query
  2. Tool returns 422 error immediately

Claude Model

Other

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.0.9

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

i use custom model, it is ZhipuAI/GLM-4.6

View original on GitHub ↗

12 Comments

dashidhy · 10 months ago

Found the same issue today, also happened after connecting to GLM 4.6 (doc). It is obvious that the ANTHROPIC_BASE_URL serves as the API host for using the WebSearch tool. However, your model customizing changes the API host setting, causing the tool to fail. If you remove the settings.json, you will find the WebSearch tool comes back (for sure, you also lose your GLM).

I was wondering whether Anthropic really supports third-party models connecting to Claude Code, or this is only just a hack to use customized models. 🤔

eapiova · 10 months ago

same, maybe related to this?

shrwnsan · 9 months ago

I've tried this with the Z.ai Web Search MCP Server:
https://docs.z.ai/devpack/mcp/search-mcp-server

Seems to work in early testing.

Though SOL if custom model doesn't have something like this.

Meanwhile, as I'm still learning... seems the Search-Plus plugin would be clutch for those in this bind:
https://github.com/shrwnsan/vibekit-claude-plugins/tree/main/plugins/search-plus

  • No need for any API service access to start
  • It also goes beyond "Did 0 search..." errors

Hope this helps

alfredocs16-lab · 9 months ago

Facing the same here.
Using Claude Code version 2.0.50.
I have been able to reproduce the issue using the following custom models: Minimax M2 and GLM 4.6.
It is working correctly with Kimi K2 and Claude models.

Any ideas on how to fix?

shrwnsan · 9 months ago

Seems quiet for the time being @alfredocs16-lab

Check on the webSearchPrime MCP from Z.ai if you are using their inference for GLM. Check w/ your inference provider, perhaps they have search MCP too w/ your MiniMax M2 plan.

Else, can try the Search Plus plugin if needed to smooth out your flow

Cheers!

dashidhy · 9 months ago
Facing the same here. Using Claude Code version 2.0.50. I have been able to reproduce the issue using the following custom models: Minimax M2 and GLM 4.6. It is working correctly with Kimi K2 and Claude models. Any ideas on how to fix?

Agree with @shrwnsan that using a third-party search MCP is a walkaround. It is a bit surprising that Kimi K2 works. How?

alfredocs16-lab · 9 months ago

Thank you @shrwnsan and @dashidhy for the insights!
I've successfully tested MCP Web Search Prime with GLM 4.6, and it's working flawlessly.

@dashidhy I can confirm that Kimi K2 Thinking works seamlessly with Claude Code's native Web Search tool with no external MCP required. This actually explains my initial confusion: I was expecting GLM and MiniMax to have the same out-of-the-box compatibility.

github-actions[bot] · 8 months ago

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

shrwnsan · 8 months ago

Any others still experiencing this w/ latest CC version?

github-actions[bot] · 7 months ago

This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.

marcindulak · 7 months ago

This issue was closed incorrectly despite recent human comments. This behavior of the bot is reported at https://github.com/anthropics/claude-code/issues/16497. Please upvote that issue, so maybe it gets noticed.

github-actions[bot] · 6 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.