fix(models): Fix the zero result from the WebSearch tool#50
Merged
mirrorange merged 1 commit intomirrorange:mainfrom Mar 12, 2026
Merged
Conversation
* relax the Tool request model so Claude Code server tools no longer require a top-level input_schema field during request validation * accept custom tools that keep their schema under custom.input_schema instead of flattening that field onto the tool object * preserve support for optional tool metadata such as type, description, and nested custom configuration without rejecting relay requests up front * add request-model regressions for both server web-search tools and custom tool payloads sent by Claude Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The WebSearch tool always returns 0 result from the previous version. The rationale behind this issue is that we enforced
input_schemaforToolrequests, while the WebSearch requests may be sent in the following shapes:{"type":"web_search_20250305","name":"web_search","max_uses":5}{"type":"custom","name":"WebSearch","custom":{"input_schema":...}}Since they didn't fit the
Tooldefinition, those requests were rejected:We introduced several fixes for this issue:
Toolrequest model so Claude Code server tools no longer require a top-levelinput_schemafield during request validationcustom.input_schemainstead of flattening that field onto the tool objecttype,description, and nested custom configuration without rejecting relay requests up frontThe WebSearch tool retrieved the result successfully after the fixes: