crewAI icon indicating copy to clipboard operation
crewAI copied to clipboard

[Bug] Bedrock tool call arguments silently dropped — tool invoked with empty input

Open krishnamohanathota opened this issue 7 months ago • 2 comments

Description

When using CrewAI with an AWS Bedrock LLM (e.g. Amazon Nova Pro via bedrock/us.amazon.nova-pro-v1:0), tool arguments are silently discarded. The LLM correctly calls the tool with the right arguments, but the tool receives an empty dict {}, causing either a TypeError (missing required positional argument) or a Pydantic ValidationError (field required).

Affected versions: Confirmed in 1.9.3 and 1.13.0.

Steps to Reproduce

  1. Define a BaseTool with a required parameter: from crewai.tools import BaseTool
    from pydantic import BaseModel, Field from typing import Type

class CityInput(BaseModel):
city: str = Field(..., description="City name")

class TravelTool(BaseTool): name: str = "get_travel_details"
description: str = "Get travel details for a city." args_schema: Type[BaseModel] = CityInput

  def _run(self, city: str) -> str:                                                                                                                                                                                                             
      return f"Details for {city}" 
  1. Assign this tool to a CrewAI agent backed by a Bedrock LLM: llm = LLM(model="bedrock/us.amazon.nova-pro-v1:0", temperature=0)
    agent = Agent(tools=[TravelTool()], llm=llm, ...)

  2. Run the crew. The Bedrock LLM correctly calls get_travel_details with {"city": "Paris"}, but the tool receives {}.

Error in 1.9.3:
TravelDetailsTool._run() missing 1 required positional argument: 'city'

Error in 1.13.0:
Tool 'get_travel_details' arguments validation failed: 1 validation error for CityInput city
Field required [type=missing, input_value={}, input_type=dict]

Root Cause

File: crewai/agents/crew_agent_executor.py

In _handle_native_tool_calls / _extract_tool_call_info (line varies by version), the code that extracts tool arguments handles multiple LLM response formats:

func_info = tool_call.get("function", {})
func_args = func_info.get("arguments", "{}") or tool_call.get("input", {})

Bedrock's Converse API returns tool calls in this format:
{"name": "get_travel_details", "toolUseId": "abc123", "input": {"city": "Paris"}}

There is no "function" wrapper, so func_info = {}.

func_info.get("arguments", "{}") returns the default string "{}", which is truthy.

The or short-circuits — tool_call.get("input", {"city": "Paris"}) is never evaluated.

func_args becomes "{}", and after json.loads("{}"), args_dict = {}. The actual Bedrock arguments are completely lost.

Expected behavior

The tool should be invoked with the arguments from tool_call["input"] when processing a Bedrock-format tool call response.

Screenshots/Code snippets

Change the default from "{}" to None:

Before

func_args = func_info.get("arguments", "{}") or tool_call.get("input", {})

After

func_args = func_info.get("arguments") or tool_call.get("input", {})

With None as default, func_info.get("arguments") returns None (falsy) when no "function" wrapper is present, so the or correctly falls through to tool_call.get("input", {...}).

Operating System

Ubuntu 20.04

Python Version

3.12

crewAI Version

1.13.0

crewAI Tools Version

1.13.0

Virtual Environment

Venv

Evidence

Iteration: 1
│
│ Attempt: 0
│
│ Error: Tool 'get_travel_details' arguments validation failed: 1 validation error for TravelDetailsInput
│
│ city
│
│ Field required [type=missing, input_value={}, input_type=dict]
│
│ For further information visit https://errors.pydantic.dev/2.11/v/missing
│
│ Expected arguments: {"city": {"description": "Name of the city to retrieve travel details for.", "title": "City", "type": "string"}}
│
│ Required: ["city"]

Possible Solution

Change the default from "{}" to None:

Before

func_args = func_info.get("arguments", "{}") or tool_call.get("input", {})

After

func_args = func_info.get("arguments") or tool_call.get("input", {})

With None as default, func_info.get("arguments") returns None (falsy) when no "function" wrapper is present, so the or correctly falls through to tool_call.get("input", {...}).

Additional context

NA

krishnamohanathota avatar Apr 05 '26 00:04 krishnamohanathota

I submitted a fix for this: #5277. The issue was the default value of '{}' in func_info.get('arguments', '{}') which is truthy and prevents the or-chain from falling through to the Bedrock input format. Changed to None so it falls through correctly.

TheCodingDragon0 avatar Apr 05 '26 01:04 TheCodingDragon0

Hi, I'm Dexing Liu from Qijing Digital Technology. We've been building the Agent Delivery Engineering (ADE) Failure Registry — a curated, cross-architecture knowledge base of AI agent failure patterns, organized by a five-layer taxonomy (Channel → Observability → Data → Cognitive → Behavior).

ADE (Agent Delivery Engineering) is an engineering discipline focused on stability forces in AI agent systems — the engineering movement of humans against intelligence entropy.

Your report here has been documented as a case study in our registry — it's an excellent example of the failure pattern it describes, and we've credited you as the discoverer.

We're actively collecting and classifying similar failures across all agent frameworks (Hermes, CrewAI, AutoGen, LangChain, etc.) to build a comprehensive reference for the community. If you have more cases or would like to contribute, we'd love your help:

  • Registry: https://github.com/ADE-standard/ade-failure-registry
  • How to contribute: https://github.com/ADE-standard/ade-failure-registry/blob/main/CONTRIBUTING.md

Thanks for the detailed report — it's helping make agent systems more reliable for everyone.

tobiglevent001 avatar Jun 18 '26 01:06 tobiglevent001