Agent FixboardAgentFixboard

Single-tool calls fail with tool_choice 400

With one tool and available_functions, LLM.call fails with 400 tool_choice: type "tool" and "any" are not supported for this model.

From GitHub

crewAIInc/crewAI

Difficulty
Moderate
Time
~15 min
Steps
3
Fixed in
—
Last checked

Unverified: we could not confirm from the sources that a fix shipped. Source: PR #8282 merged. Last checked 2026-10-25.

Symptom

With one tool and available_functions, LLM.call fails with 400 tool_choice: type "tool" and "any" are not supported for this model.

Evidence what you'll see

  • On crewAI 1.15.27, the request built for one of the newer models named in the issue, with a single get_weather tool, printed tool_choice sent by crewAI: {'type': 'tool', 'name': 'get_weather'}.
  • The reporter had no API access, so the issue shows the request crewAI builds, not a live response. The same 400 error was recorded live for these models in pull request #7726 (issue #7725), on the other provider path, where crewAI forced a tool for structured output rather than for a single tool.
  • The forcing code in _prepare_completion_params was params["tool_choice"] = {"type": "tool", "name": tool_name}, used when available_functions is set and there is exactly 1 regular tool.

Why it happens

available_functions only tells crewAI that it can run the tool. The native provider code also used it to force the model to call that tool with a named tool_choice. The newer models named in the issue reject a tool or any tool_choice, so a single-tool call with available_functions on those models is rejected with that 400.

Affected versions

crewAI 1.15.28 as reported, with the same request shown on 1.15.27. Ubuntu 20.04, Python 3.10, with the native provider extra from the first fix step installed. The issue names two newer models on that provider; the repro under verification uses one of them.

Fix steps

0 of 3 done

Your check marks stay in this browser only.

How to check it worked

  • pip show crewai reports 1.15.29 or later.
  • Rerun the issue's repro with LLM(model="anthropic/claude-sonnet-5-5") and llm.call("What's the weather in Paris?", tools=[weather_tool], available_functions={"get_weather": lambda city: "sunny"}). It should return a tool call or a text answer, not a 400.
  • Without API access, check the built request: params["tool_choice"] == {"type": "auto"}, which is what test_single_tool_with_available_functions_uses_auto_choice asserts.

If it still fails

  • With auto, the model may answer in text instead of calling the tool. Pull request 8282 makes that the intended behavior, so it is not a new failure.
  • If the same 400 comes from structured-output calls on the other provider path, that is issue #7725. Pull request 7726 was still open on 2026-10-25.
  • The 1.15.29 release notes do not name this fix. The version comes from comparing tags with merge dec075b5e424ab0880fe9a2e9e8e13e3af367742: tag 1.15.29 contains it and tag 1.15.28 does not.

Sources and credit

Summarized in our own words from these public reports. Credit goes to their authors.

Provided as is, without warranty. Try changes in a non-production environment and back up first. Security-related steps: verify against the official docs. Terms · Request removal or attribution change

Hit an error we don't cover? Submit it