Add support for strict parameter in Anthropic tool schemas - #16725
Merged
2 commits merged intoNov 18, 2025
Merged
Conversation
|
@Bradley-Butcher is attempting to deploy a commit to the CLERKIEAI Team on Vercel. A member of the Team first needs to authorize it. |
ghost
reviewed
Nov 18, 2025
| "additionalProperties": Optional[bool], | ||
| "required": Optional[List[str]], | ||
| "$defs": Optional[Dict], | ||
| "strict": Optional[bool], |
There was a problem hiding this comment.
do you mind documenting this new feature @Bradley-Butcher
Here would be great:
4 tasks
Ryze0323
added a commit
to Ryze0323/litellm
that referenced
this pull request
Apr 8, 2026
…oolSpec Bedrock Converse API supports strict: true in toolSpec since 2026-02-04 (GA). Previously, both strict and additionalProperties were implicitly dropped during OpenAI-to-Bedrock tool conversion because ToolSpecBlock and ToolJsonSchemaBlock only whitelisted a subset of fields. This change: - Adds strict to ToolSpecBlock and passes it through when present - Adds additionalProperties to ToolJsonSchemaBlock and passes it through when present (required by Bedrock when strict: true is set) Without additionalProperties: false, Bedrock rejects strict: true requests with: "For 'object' type, 'additionalProperties' must be explicitly set to false" Fixes the gap where Anthropic direct API path already supports strict (PR BerriAI#16725) but Bedrock Converse path does not.
This was referenced Jun 5, 2026
fzowl
pushed a commit
to fzowl/litellm
that referenced
this pull request
Jun 24, 2026
…#16725) * support anthropic strict tools * correct comment from copy-paste
This pull request was closed.
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.
Add support for strict parameter in Anthropic tool schemas
Relevant issues
N/A
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
tests/litellm/directory, Adding at least 1 test is a hard requirement - see detailsmake test-unit- existing tests are failing with default setup script. Can give details if required.Type
🆕 New Feature
Changes
Problem:
Anthropic's API now supports a
strictparameter in tool input schemas with the beta header flag:structured-outputs-2025-11-13for structured outputs, but LiteLLM filters it out during the OpenAI → Anthropic parameter mapping. See https://docs.claude.com/en/docs/build-with-claude/structured-outputs#strict-tool-use for further details.Solution:
"strict": Optional[bool]to theAnthropicInputSchemaTypedDict inlitellm/types/llms/anthropic.py(line 28)strictparameter to pass through the filter inlitellm/llms/anthropic/chat/transformation.py(lines 206-212)test_anthropic_strict_parameter_passthroughto verify the parameter is correctly passed throughImpact:
Users can now use Anthropic's strict mode for tool calling by including
"strict": truein their tool parameters