Repository navigation
fix(server): name the unsupported anthropic tool type in the 400 instead of a missing input_schema - #959
Merged
Conversation
…ead of a missing input_schema
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.
Claude Code's WebSearch sends an Anthropic-defined tool,
{"type": "web_search_20250305", "name": "web_search", "max_uses": 8}, with noinput_schema./v1/messagesanswered with a 400 sayingtools.0.input_schema: Field required, which points the client at its schema instead of at the tool type this server does not support.Changes
AnthropicTool: amode="before"model validator rejects a tool that has noinput_schemaand atypeother thancustom, withtool type '<type>' is not supported; only custom tools with an input_schema are. This covers the Anthropic-defined tools (web_search_*,bash_*,text_editor_*, ...). Custom tools, with or withouttype: "custom", are validated as before.The request is still a 400 in the Anthropic error envelope; only the message changes.
vLLM rejects these tools the same way (
reject_anthropic_defined_toolsin its Anthropic protocol). SGLang drops them from the tool list with an info log and serves the request.Tests
tests/server/test_anthropic_api.py::test_validation_error_uses_anthropic_envelope: aweb_search_20250305tool gets a 400 that names the type.pytest tests/server: 689 passed.