diff --git a/src/crewai/tools/tool_usage.py b/src/crewai/tools/tool_usage.py index d4d128dbde..b1b241aa09 100644 --- a/src/crewai/tools/tool_usage.py +++ b/src/crewai/tools/tool_usage.py @@ -369,7 +369,7 @@ def _validate_tool_input(self, tool_input: str) -> str: formatted_value = value.lower() else: # Assume the value is a string and needs quotes - formatted_value = '"' + value.replace('"', '\\"') + '"' + formatted_value = '"' + value.strip('"').replace('"', '\\"') + '"' # Rebuild the entry with proper quoting formatted_entry = f'"{key}": {formatted_value}'