{"record":{"id":"8d004f25f015cfc1","repo":"BerriAI/litellm","slug":"incompatible-tool-choice-param-submitted-tool-c","errorCode":null,"errorMessage":"Incompatible tool choice param submitted - {tool_choice}","messagePattern":"Incompatible tool choice param submitted - (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/anthropic/experimental_pass_through/adapters/transformation.py","lineNumber":713,"sourceCode":"        return reasoning_effort\n\n    def translate_anthropic_tool_choice_to_openai(\n        self, tool_choice: AnthropicMessagesToolChoice\n    ) -> ChatCompletionToolChoiceValues:\n        if tool_choice[\"type\"] == \"any\":\n            return \"required\"\n        elif tool_choice[\"type\"] == \"auto\":\n            return \"auto\"\n        elif tool_choice[\"type\"] == \"tool\":\n            # Truncate tool name if it exceeds OpenAI's 64-char limit\n            original_name: Final = tool_choice.get(\"name\", \"\")\n            truncated_name: Final = truncate_tool_name(original_name)\n            tc_function_param: Final = ChatCompletionToolChoiceFunctionParam(name=truncated_name)\n            return ChatCompletionToolChoiceObjectParam(type=\"function\", function=tc_function_param)\n        elif tool_choice[\"type\"] == \"none\":\n            return \"none\"\n        else:\n            raise ValueError(f\"Incompatible tool choice param submitted - {tool_choice}\")\n\n    def translate_anthropic_tools_to_openai(\n        self, tools: list[AllAnthropicToolsValues], model: str | None = None\n    ) -> tuple[list[ChatCompletionToolParam], dict[str, str]]:\n        \"\"\"\n        Translate Anthropic tools to OpenAI format.\n\n        Returns:\n            Tuple of (translated_tools, tool_name_mapping)\n            - tool_name_mapping maps truncated names back to original names\n              for tools that exceeded OpenAI's 64-char limit\n        \"\"\"\n        new_tools: Final[list[ChatCompletionToolParam]] = []\n        tool_name_mapping: Final[dict[str, str]] = {}\n        # \"type\" is the Anthropic tool type (e.g. \"custom\"); it must not be\n        # merged into the OpenAI function `parameters` schema below, or it\n        # overwrites the real parameters.type (\"object\") and the provider\n        # rejects the request. See #30557.","sourceCodeStart":695,"sourceCodeEnd":731,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/anthropic/experimental_pass_through/adapters/transformation.py#L695-L731","documentation":"Error \"Incompatible tool choice param submitted - {tool_choice}\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/anthropic/experimental_pass_through/adapters/transformation.py:713 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a tool_choice value compatible with Anthropic ('auto', 'any', 'none', or {'type':'tool','name':...}).","Remove tool_choice or set drop_params=True to drop it."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}